Function isreal - complex numbers, MATLAB in Mathematics

Function isreal - complex numbers:

The function isreal returns 1 for logical true when there is no imaginary part of the argument, or 0 for false when the argument does have an imaginary part (even if it is 0). For illustration,

>> isreal(z1)

ans =

   0

>> z5 = complex(3)

z5 =

   3

>> isreal(z5)

ans =

   0

>> isreal(3.3)

ans =

   1

 

For the variable z5, however it displays the answer as 3, it is really stored as 3 + 0i, and that is how it is exhibited in the Workspace Window. And hence, isreal returns logical false as it is stored as a complex number.

Posted Date: 10/22/2012 8:55:45 AM | Location : United States







Related Discussions:- Function isreal - complex numbers, Assignment Help, Ask Question on Function isreal - complex numbers, Get Answer, Expert's Help, Function isreal - complex numbers Discussions

Write discussion on Function isreal - complex numbers
Your posts are moderated
Related Questions
Creating string Variables: The string consists of a few numbers of characters (including, possibly, none). These are the illustrations of the strings: '' 'x' 'ca

Example of Logical built-in functions: For equivalent to all the function, we should make sure that the entire elements in the vector are logically true. The one way of doing

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result

Blanks function: The blanks function will generate a string consisting of n blank characters-that are kind of hard to see here! Though, in a MATLAB if the mouse is moved to hi

Program of built-in factorial function: Calling this function yields similar result as the built-in factorial function: >> fact(5) ans =   120 >> factorial(

Logical Vectors: The relational operators can also be used with the vectors and matrices. For illustration, let's say that there is a vector, and we want to compare each eleme

Indexed empty matrix: The Individual elements cannot be eliminated from matrices, as matrices always have the similar number of elements in every row. >> mat = [7 9 8; 4 6

Empty Vectors: An empty vector or in another words, a vector which stores no values, can be generated using the empty square brackets: >> evec = [] evec = [] >> lengt

Illustration of a recursive function: illustration is of a recursive function which does not return anything, but simply prints. The below function prtwords receives a sentenc

Symbolic Expression The solve function solves an equation and returns the solution(s) as symbolic expressions. The answer can be converted to numbers by using any numeric funct