From: ImageAnalyst on
memo:
No doubt you've found the error by now.
You didn't give any condition on your "if" line. It needs to say
if (condition)
% Stuff to do if condition == true
else
% Stuff to do if condition == false
end

The else is optional of course.
Your problem was that you had no condition whatsoever.

Secondly you did
M(i,j,1:3) = hr[255 0 0 ];
What is hr[255 0 0 ]? What is hr? Is it a function or an array or a
scalar? If hr is a scalar you need to have a * in between it and the
bracket to do the multiply. If it's a function or array, you need to
have parentheses instead of brackets and use commas between the
numbers. If that is actually the condition of the if, then you also
need to put it on the same line as the if, get rid of the semicolon,
and use == instead of =.

And then review the Getting Started section of the help.

The small chunk of code I gave you was not large at all - far from
it. My typical "real world" MATLAB application is about 2000 lines of
code, so I think anything less than about 500 lines is tiny. But
nonetheless, feel free to adapt it or simplify it as you see fit.
Regards,
ImageAnalyst
First  |  Prev  | 
Pages: 1 2
Prev: problem with mex
Next: java heap space error