Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Combining series of matrices
Replies: 10   Last Post: Jan 26, 2013 10:05 AM

 Messages: [ Previous | Next ]
 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,:);
end
index1=find(Luminance{ind,1}.data(:,1)==0);
Luminance{ind,1}.data(index1,:)=[];
else
str=['Warning file ',datestr(date),' does not exist'];
display(str)
end
date=date+1;
ind=ind+1;
end

Date Subject Author
1/20/13 Ehsan
1/20/13 dpb
1/20/13 james bejon
1/20/13 Ehsan
1/20/13 james bejon
1/20/13 Ehsan
1/21/13 dpb
1/22/13 dpb
1/22/13 dpb
1/26/13 Ehsan
1/26/13 dpb