what does "It is not detecting if a matrix is even or non-square" mean?

1 view (last 30 days)
i was asked to do a few simple exercises but since i am new to matlab, it is not as easy as it seems.. how would you show(in a function) the size of a matrix?

Accepted Answer

Roger Stafford
Roger Stafford on 19 Mar 2015
[m,n] = size(M);
  3 Comments
Roger Stafford
Roger Stafford on 19 Mar 2015
At a guess I would say this is a statement made by a human who does not approve of an aspect of some code which is to receive input from a user, because that input is not being tested for possible incorrect form. For example, suppose a code is to receive a number, n, which is to be used as an integer. It is a good policy to test the number after being received to see if it is actually an integer, say, by the test:
if n~=round(n), error('Input value should be an exact integer'), end

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!