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
Types of User-defined Functions: We know how to write a user-defined function, stored in an M-file, which computes and returns one value. This is merely one type of the functi

This project requires you to use the ideas of Chapter 25 regarding maximization of a function. Here we assume that evolution has acted to generate highly efficient foragers. By hig

If I have a vector representing the packed storage form of a symmetric matrix, how do I perform a cholesky factorisation on that?

Applications of Customized Strings: Labels, Prompts, Arguments to Functions: The one of very useful application of this is to involve numbers in strings that are used to plot

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

Three-dimensional pie and bar: For the bar3 function, x & y vectors are passed and the function displays three-dimensional bars as shown in figure: Figure: Three-dimen

Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

Strings as Vectors: The Strings are considered as vectors of characters-or in another words, a vector in which each and every element is a single character-so numerous vector

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

Script a MATLAB program which meets the following speci cations: The program expects an input of a two-variable real-valued continuous function f : R^2--> R The program is to cal