matlab中scan怎么用 [r c] = size(f); label = zeros(r,c); scan = zeros(r+1,c+2); %扩充原始图像的边界[r c] = size(f);label = zeros(r,c);scan = zeros(r+1,c+2); %扩充原始图像的边界以便检测scan(1:r+1,2:c+1) = f;出现:Subscripte
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 12:03:52
matlab中scan怎么用 [r c] = size(f); label = zeros(r,c); scan = zeros(r+1,c+2); %扩充原始图像的边界[r c] = size(f);label = zeros(r,c);scan = zeros(r+1,c+2); %扩充原始图像的边界以便检测scan(1:r+1,2:c+1) = f;出现:Subscripte
matlab中scan怎么用 [r c] = size(f); label = zeros(r,c); scan = zeros(r+1,c+2); %扩充原始图像的边界
[r c] = size(f);
label = zeros(r,c);
scan = zeros(r+1,c+2); %扩充原始图像的边界以便检测
scan(1:r+1,2:c+1) = f;
出现:Subscripted assignment dimension mismatch.
Error in ==> U1ntitled at 11
scan(1:r+1,2:c+1) = f;
matlab中scan怎么用 [r c] = size(f); label = zeros(r,c); scan = zeros(r+1,c+2); %扩充原始图像的边界[r c] = size(f);label = zeros(r,c);scan = zeros(r+1,c+2); %扩充原始图像的边界以便检测scan(1:r+1,2:c+1) = f;出现:Subscripte
错误如下:
你的最后一句scan(1:r+1,2:c+1) = f中,后面是r*c的,而前面是(r+1)*c的,因此报错
改成如下可以运行.
clc
f=[1 1 ;1 1 ]
[r c] = size(f);
label = zeros(r,c);
scan = zeros(r+2,c+2); %扩充原始图像的边界以便检测
scan(2:r+1,2:c+1) = f;