MATLAB 图像算法问题 Too many input arguments.g1是一副二值图像:[N1,N2]=size(g1);for i=2:N1for j=2:N2-1g1(i,j)=min(g1(i-1,j-1)+4,g1(i-1,j)+3,g1(i-1,j+1)+4,g1(i,j-1)+3,g1(i,j))endend运行后会报错:Error using ==> minToo many input a
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 02:29:47
MATLAB 图像算法问题 Too many input arguments.g1是一副二值图像:[N1,N2]=size(g1);for i=2:N1for j=2:N2-1g1(i,j)=min(g1(i-1,j-1)+4,g1(i-1,j)+3,g1(i-1,j+1)+4,g1(i,j-1)+3,g1(i,j))endend运行后会报错:Error using ==> minToo many input a
MATLAB 图像算法问题 Too many input arguments.
g1是一副二值图像:
[N1,N2]=size(g1);
for i=2:N1
for j=2:N2-1
g1(i,j)=min(g1(i-1,j-1)+4,g1(i-1,j)+3,g1(i-1,j+1)+4,g1(i,j-1)+3,g1(i,j))
end
end
运行后会报错:
Error using ==> min
Too many input arguments.
小弟MATLAB新手求大神帮助
MATLAB 图像算法问题 Too many input arguments.g1是一副二值图像:[N1,N2]=size(g1);for i=2:N1for j=2:N2-1g1(i,j)=min(g1(i-1,j-1)+4,g1(i-1,j)+3,g1(i-1,j+1)+4,g1(i,j-1)+3,g1(i,j))endend运行后会报错:Error using ==> minToo many input a
min函数只能同时求两个数的最小值,你输入了5个值,肯定提示输入参数太多了,可以改为:
g1(i,j)=min(g1(i-1,j-1)+4,min(g1(i-1,j)+3,min(g1(i-1,j+1)+4,min(g1(i,j-1)+3,g1(i,j)))));