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
sprintf function: The sprintf function works precisely like the fprintf function, but rather than printing it generates a string. Here are some illustrations in which the outp

Illustration of Writing variables to a file: For illustration, in the below session in the Command Window, 3 variables are generated; these are then exhibited using who. Then,

fprintf function - File function: The fprintf function really returns the number of bytes which was written to the file, therefore if you do not want to see that number, suppr

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

Common form of the switch statement: The common form of the switch statement is as shown below:   switch switch_expression   case caseexp1    action1   case cas

Customizing Plots : There are numerous ways to customize figures in the Figure Window. On clicking the Plot Tools icon will bring up the Property Editor & Plot Browser, with ma

Illustration of Spreadsheet Files: This reads the numbers in a double vector variable nums and the text in a cell array txt (the xlsread function forever returns the numbers f

bar and barh functions: For a matrix, the bar and barh functions will group altogether the values in each and every row. The illustration is as shown: rm = randint(2,4,[1

Illustration of Writing to files: Here is the other illustration in which a matrix is written to a file. At First, an arbitrary 2 × 4 matrix is generated, and then it is writt

Using Functions with the Vectors and Matrices: As MATLAB is written to work with the vectors and matrices, the whole vector or matrix can be passed as an argument to the funct