Ehsan
Posts:
9
Registered:
12/7/12
|
|
Re: Combining series of matrices
Posted:
Jan 20, 2013 12:30 PM
|
|
"james bejon" wrote in message <kdh908$g0c$1@newscl01ah.mathworks.com>... > If you supply some code that generates the relevant data structure, I'll happily have a go...
ind=1; while date<=end_date filename=sprintf('SS%s.csv',datestr(date,'yymmdd')); if exist(filename,'file') %display('OK!') data{ind,1}=importdata(filename,',',9); m=size(data{ind,1}.data(:,2)); time=zeros(m(1,1),1); for n=1:m(1,1) time(n,1)=datenum(data{ind,1}.textdata(n+9,2),'HH:MM:ss'); end time=date+time-735235; data{ind,1}.data=[datevec(time),data{ind,1}.data]; r=size(data{ind,1}.data(:,2)); for i=1:2:r Luminance{ind,1}.data(ceil(0.5*i),:)=data{ind,1}.data(i,:); Radiance{ind,1}.data(ceil(0.5*i),:)=data{ind,1}.data(i+1,:); end index1=find(Luminance{ind,1}.data(:,1)==0); Luminance{ind,1}.data(index1,:)=[]; index2=find(Radiance{ind,1}.data(:,1)==0); Radiance{ind,1}.data(index2,:)=[]; else str=['Warning file ',datestr(date),' does not exist']; display(str) end date=date+1; ind=ind+1; end
|
|