23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Getting Information About a Matrix<br />

5.8909<br />

Example Using ndims, numel, and size<br />

Using ndims and size, go through the matrix and find those values that are<br />

between 5 and 7, inclusive:<br />

if ndims(A) ~= 2<br />

return<br />

end<br />

[rows cols] = size(A);<br />

for m = 1:rows<br />

for n = 1:cols<br />

x = A(m, n);<br />

if x >= 5 && x

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

Saved successfully!

Ooh no, something went wrong!