loops and xlsread.
显示 更早的评论
hello everybody,
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.
A=[0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]
for i=1:75 %all the excels i have
[values(i)]=xlsread('i.xls','B10:B5010');
smooth(i)=sgolayfilt(values(i),1,447);
surf(i)=trapz(0.04,smooth(i));
Graph=[A(i) surf(i)]
end
plot(Graph)
xlswrite('essai',Graph)
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
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!