MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]这个错误应该怎么改? (https://www.labfans.com/bbs/showthread.php?t=6730)

Jael 2009-03-08 21:26

[求助]这个错误应该怎么改?
 
我写了一段读图像的程序,H是用于读头文件,然后x从头文件后开始处理图像部分数倨
load('CrimeFprint.mat');
p=fopen('CrimeFprint.mat');
[y t]=fread(p);
[r1 r2]=size(y);
H=r1-(512*512);
x=y((H+1):t);
X=reshape(x,512,512);
a=unit8(X);
A=im2double(a);
imshow(A);
运行后错误如下:??? Subscript indices must either be real positive integers or logicals.

Error in ==> dippart2 at 6
x=y((H+1):t);
这是为什么?应该怎么改正?

matfan 2009-03-14 02:15

回复: [求助]这个错误应该怎么改?
 
错误说下标必须为正整数或者逻辑值,你的下标不符合要求。
貌似x=y((H+1):t)中,H+1有为负值的时候,仔细检查吧。


所有时间均为北京时间。现在的时间是 12:41

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.