谢谢,我刚做了个程序,应该解决了问题,分享下
%因为是分钟数据,所以date中单个日期会有很多值与time对应
M=unique(date);
m=length(M);
n=length(date);
for i=1:m
for j=1:n
if strcmp(date{j},M(i))==0
continue;
else
a=j;
break;
end;
end;
for j=n:-1:1
if strcmp(date{j},M(i))==0
continue;
else
b=j;
break;
end;
end;
end;
这样每个M中日期值都可以在date中找到位置a到b