13.01.2015 Views

Chapter 4: Programming with MATLAB - FET

Chapter 4: Programming with MATLAB - FET

Chapter 4: Programming with MATLAB - FET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Logical function<br />

ischar(A)<br />

isempty(A)<br />

isinf(A)<br />

isnan(A)<br />

Logical functions Table 4.3–4 (continued)<br />

Definition<br />

Returns a 1 if A is a character array and 0 therwise.<br />

Returns a 1 if A is an empty matrix and 0 otherwise.<br />

Returns an array of the same dimension as A, <strong>with</strong><br />

ones where A has ‘inf’ and zeros elsewhere.<br />

Returns an array of the same dimension as A <strong>with</strong><br />

ones where A has ‘NaN’ and zeros elsewhere. (‘NaN’<br />

stands for “not a number,” which means an<br />

undefined result.)<br />

isnumeric(A) Returns a 1 if A is a numeric array and 0 otherwise.<br />

isreal(A) Returns a 1 if A has no elements <strong>with</strong> imaginary<br />

parts and 0 otherwise.<br />

logical(A) Converts the elements of the array A into logical<br />

values.<br />

xor(A,B) Returns an array the same dimension as A and B;<br />

the new array has ones where either A or B is<br />

nonzero, but not both, and zeros where A and<br />

B are either both nonzero or both zero.<br />

4-14<br />

Z.R.K

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!