how can expand a m file?
이전 댓글 표시
this is a m file for one xml file. how can i change it for show(plot,mat file and etc)more exel files? m file is :
clc
clear all
close all
[numdata,txtdata]=xlsread(['subject_1.xls']);
Ankle_saj_1=numdata(:,2);
max_pf_1=min(Ankle_saj_1);
max_df_1=max(Ankle_saj_1);
save('Ankle_saj_var_1','max_pf_1','max_df_1')
plot(Ankle_saj_1)
saveas(gcf,'Ankle_saj_1.fig')
[Merged information from duplicate question]
i have this m file:
[numdata,txtdata]=xlsread(['subject_1.xls']);
Ankle_saj_1=numdata(:,2);
max_pf_1=min(Ankle_saj_1);
max_df_1=max(Ankle_saj_1);
save('Ankle_saj_var_1','max_pf_1','max_df_1')
plot(Ankle_saj_1)
saveas(gcf,'Ankle_saj_1.fig')
-this m file collect data (Ankle_saj_1 , max_pf_1 , max_df_1 and plot(Ankle_saj_1)) from subject_1.xls and show them and finally save it. now, i have 10 xls file (subject_1 subject_2 ,...,subject_10). i need this data for all xls file to compare them.(for example: show 10 plot in one window to see all). Joes said that i need structure and loop to show all of them.i'm amautor and dont know about this works. please help me,this is for CP persons.thanks. download m file
댓글 수: 3
Walter Roberson
2012년 12월 17일
Is this different than your previous question http://www.mathworks.co.uk/matlabcentral/answers/56687-how-show-some-exel-file-together-in-matlab ?
Mahan Soltani
2012년 12월 17일
Jan
2012년 12월 17일
@Mohammad: If this is the same problem, please do not post another question. Such "double posting" is inefficient for you and for all readers, because it is additional work to keep the overview over both threads. Therefore double-posts are delete usually.
채택된 답변
추가 답변 (1개)
Walter Roberson
2012년 12월 17일
0 개 추천
In order to use it for more excel files, you need to remove the "clear all"
댓글 수: 4
Mahan Soltani
2012년 12월 17일
Walter Roberson
2012년 12월 17일
I assure you, you have no chance of getting that program to work for multiple files unless you remove the "clear all".
Walter Roberson
2012년 12월 17일
* Clear All Variables And Functions
clear all
This is not for erasing the previous command. "clear all" is like driving a car down a highway and suddenly all of the gasoline is gone and suddenly all of the air is gone from the tires and suddenly the car is turned off and the keys are not even in the ignition anymore.
Walter Roberson
2012년 12월 17일
편집: Walter Roberson
2012년 12월 17일
Perhaps you were composing that comment while I was posting the answer...
The problem is not simple because you want the saved variable names to match the subject number.
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!