how can expand a m file?
Show older comments
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 Comments
Walter Roberson
on 17 Dec 2012
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
on 17 Dec 2012
Jan
on 17 Dec 2012
@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.
Accepted Answer
More Answers (1)
Walter Roberson
on 17 Dec 2012
0 votes
In order to use it for more excel files, you need to remove the "clear all"
4 Comments
Mahan Soltani
on 17 Dec 2012
Walter Roberson
on 17 Dec 2012
I assure you, you have no chance of getting that program to work for multiple files unless you remove the "clear all".
Walter Roberson
on 17 Dec 2012
* 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
on 17 Dec 2012
Edited: Walter Roberson
on 17 Dec 2012
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.
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!