MATLAB提示Error using reshape To RESHAPE the number of element
来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/05/20 07:38:39
MATLAB提示Error using reshape To RESHAPE the number of elements must not change.求大神看错在哪了
clear I;
clear G;
G=imread('I:\\2.jpg');
I=rgb2gray(G);
I=double(I);
a=ones(1,24);
n=2;
L=2;
d=de2bi(a);
[H,W]=size(I);
A=[H,W];
i=0;
A
B=reshape(A,(H*W)/n,n);
for i=1:H*W/n
for j=1:n
K(j,1)=B(i,1)*j;
end
y=mod(sum(K),(2*n+1));
r=mod((d-y),2*n+1);
if d==y
B=B;
else if =y&&rn
B(i,r)=B(i,2*n-r)-1;
end
end
end
end
clear I;
clear G;
G=imread('I:\\2.jpg');
I=rgb2gray(G);
I=double(I);
a=ones(1,24);
n=2;
L=2;
d=de2bi(a);
[H,W]=size(I);
A=[H,W];
i=0;
A
B=reshape(A,(H*W)/n,n);
for i=1:H*W/n
for j=1:n
K(j,1)=B(i,1)*j;
end
y=mod(sum(K),(2*n+1));
r=mod((d-y),2*n+1);
if d==y
B=B;
else if =y&&rn
B(i,r)=B(i,2*n-r)-1;
end
end
end
end
很明显的错误,A=[H,W];A的型号是多少?1*2
B=reshape(A,(H*W)/n,n)改后(H*W)/n*n=H*W
除非H*W=2不然必定错啊
I的型号才是H*W
B=reshape(I,(H*W)/n,n)且(H*W)/n是整数就不会出错~
再问: 改了以后着有提示Subscript indices must either be real positive integers or logicals。我没从0开始调试啊
再问: 之后提示Subscript indices must either be real positive integers or logicals,没有从0开始啊
再答: 你这是哪个语句错误呢
再问: 能加我Q详谈么:876850173
B=reshape(A,(H*W)/n,n)改后(H*W)/n*n=H*W
除非H*W=2不然必定错啊
I的型号才是H*W
B=reshape(I,(H*W)/n,n)且(H*W)/n是整数就不会出错~
再问: 改了以后着有提示Subscript indices must either be real positive integers or logicals。我没从0开始调试啊
再问: 之后提示Subscript indices must either be real positive integers or logicals,没有从0开始啊
再答: 你这是哪个语句错误呢
再问: 能加我Q详谈么:876850173
MATLAB提示Error using reshape To RESHAPE the number of element
reshape matlab To RESHAPE the number of elements must not ch
MAtlab中To RESHAPE the number of elements must not change.
我的MATLAB积分程序出现错误To RESHAPE the number of elements must not c
matlab运行程序时出现To RESHAPE the number of elements must not chan
关于MATLAB的reshape函数问题,reshape(A,[],
matlab中的reshape命令有什么数学意义?
matlab 提示错误是:Error using ==> plot Vectors must be the same l
Error using ==> stem The length of X must match the number o
matlab运行时出现问题In an assignment A(I) = B,the number of element
matlab 提示Error using vertcat CAT arguments dimensions are no
Matlab ,error using eq