请大侠帮忙看一下这个程序哪里错了??
fid=fopen('normalecg.txt','r');%x=fscanf(fid,' %f %f %f',);
%fid=fopen('heartfailure.txt','r');
x=fscanf(fid,' %f %f %f',);
%fid=fopen('atrialfib.txt','r');
%x=fscanf(fid,' %f %f %f',);
fclose(fid);
N=length(x);
for i=0:N/3-1
t(i+1)=x(3*i+1);
sig1(i+1)=x(3*i+2);
sig2(i+1)=x(3*i+3);
end
运行时报错:??? Error using ==> fscanf
Invalid file identifier.Use fopen to generate a valid file identifier.
还有就是这个for循环好像编译时也有问题,t might be growing inside a loop. Consider preallocating for speed.
[ 本帖最后由 chris 于 2007-4-20 10:22 编辑 ]
%正常人心律信号
fid=fopen('normalecg.txt','r');
%x=fscanf(fid,' %f %f %f',);
%充血性心脏心律信号
%fid=fopen('heartfailure.txt','r');
x=fscanf(fid,' %f %f %f',);
%心室纤维颤动心 ...
请先看看置顶贴,然后重新编辑你的帖子
页:
[1]