例如在命令窗口中 function Number=recrgb(Image,Image_HSV,h,w)电脑就会提示:Function definitions are not permitted at the prompt or in scripts.我该怎么定义
function Number=recrgb(Image,Image_HSV,h,w)
r=Image(h,w,1);
g=Image(h,w,2);
b=Image(h,w,3);
H2=Image_HSV(h,w,1);
S2=Image_HSV(h,w,2);
V2=Image_HSV(h,w,3);
if ((0.3*r+0.6*g+0.1*b)>135 &&b>100)||(H2<220&&S2<=0.3 &&V2>=0.3)
Number=1;
return;
end
if (b>r&&b>g&&H2>=190&&H2<250 &&S2>=0.25 &&V2>0.1)
Number=2;
return;
end
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Number=0;
return;
end
以上代码在命令窗口怎么写才能运行,求高手解决
德玛西亚99
炎炎设计