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
Structure Consisting of the Fields A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of th

Illustration of Labels and prompts: The program below prompts the user for endpoints (x1, y1) and (x2, y2) of a line segment, and computes the midpoint of the line segment, th

5 p2+8p+15, 3 p2-3p-18, 12 p2-p-30

Matrix of Plots: The other function which is very useful with any type of plot is subplot that creates a matrix of plots in the present Figure Window. The three arguments are

Changing Dimensions: In addition to transpose operator, the MATLAB has some built-in functions which change the dimensions or configuration of matrices, involving fliplr, resh

Write a MATLAB function [d1, u1, l1, c1, r1] = NaiveGaussArrow(d, u, l, c, r) that takes as input the 5 vectors de ned above representing A. This function performs Naive Gauss redu

Illustration of Empty vectors: The Empty vectors can also be used to delete elements from the arrays. For illustration, to remove the third element from array, an empty vector

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

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

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