tags:

views:

41

answers:

2

All are from this post.

What does these statement mean:

error(nargchk(5, 6, nargin));

plot(p(:,1), p(:,2), '.-'), axis equal

And what's this kinda syntax which I haven't quite often seen:

if nargin<6, steps = 36; end
+2  A: 

I hope I don't come over as too unhelpful, but have you tried:

  • using Matlab's built-in help facilities to discover for yourself what the various statements mean ? or
  • running any of the code ?

All the statements are Matlab intrinsics and well documented. The use of , to separate statements on the same line is a bit unusual (I, for one, would usually put the statements on different lines in your examples), but not incorrect

High Performance Mark
+1  A: 

Take a look at

help plot
help axis
help nargin
midtiby
Can you explain what's the difference of `,` and `;` in `if nargin<6, steps = 36; end`?
, sequences statements, ; suppresses output
High Performance Mark
Sorry,what do you mean by `suppresses output`,can you elaborate?
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f0-36861.html#f0-36866
James Burgess