loops and xlsread.
7 views (last 30 days)
I am new at using the program, i worked with maple before and i reason with its logic i am using the matlab to reduce some noise of some measures and every xls i export has the name 1.xls, 2.xls, 3.xls...like that until 75.xls and each one has a measure i made. After smoothing each measure, I need to calculate the surface and graph it with the A matrix. so I though of doing something like the code below.
for i=1:75 %all the excels i have
I know that the program is going to search for the i.xls file and not for 1.xls, 2.xls, 3.xls...etc. I made it so everybody could understand better the logic i took. anyone knows a way to doing it? thanks
dpb on 5 Oct 2016
A=[[0.5:0.5:21[ 22:35]; % use colon; recommend using the "Getting Started" tutorials
See the FAQ <process a sequence of files>. I'm particularly fond of the dir solution w/ wildcard for cases such as you show.
d=dir('*.xls'); % get the list of files...
for i=1:length(d) % and iterate over it...
values=xlsread(d(i).name,'B10:B5010'); % read the spreadsheet...
At this point, do the operations on the specific dataset and move on to the next. Doesn't look like you need to hold all in memory at once.