0
for i = 1:n
ymin = realmax;
ymax = 0;
for j = 1:4 % each perceptron
for k = 1:40
yval = waves0(k,j,i);
if(yval > ymax) ymax = yval;
if(yval < ymin) ymin = yval;
end
end
end
我試圖找到最小和最大值,但是當我運行的功能,我得到:如何循環分鐘?
parse error near line 20 of file /Volumes/FDISK/mlr/YvalDistance.m
syntax error
parse error near line 20 of file /Volumes/FDISK/mlr/YvalDistance.m
syntax error
parse error near line 20 of file /Volumes/FDISK/mlr/YvalDistance.m
syntax error
parse error near line 20 of file /Volumes/FDISK/mlr/YvalDistance.m
syntax error
第20行是函數的最後一行,並且是空的。 如果我評論if(yval < ymin) ymin = yval;
我再也不會收到解析錯誤了。這是怎麼回事?
octave:39> version
ans = 3.2.4
您應該關閉[if with endif](http://www.g nu.org/software/octave/doc/interpreter/The-_003ccode_003eif_003c_002fcode_003e-Statement.html#The-_003ccode_003eif_003c_002fcode_003e-Statement)但你有1k,這不是問題。 – danihp
您是否試過用endfor關閉您的for循環? – 2011-12-05 20:32:46