Exporting Data from MATLAB to EXCEL File
时间:03-30
整理:3721RD
点击:
I have this data generated in Matlab using m-file. After running the simulation for the first time and using xlswrite, it creates an excel file and saves the data.
My problem is that i want to save the final data from second simulation without having to go back to program n changing the same of the file to save. For Example;
Is it possible to do something like this!
name = input(' Please enter the simulation Name = ', 's' )
%data = contains all the simulated data
s = xlswrite('mydata.xls', data, 'simulation1', 'B1');
xlswrite('mydata.xls', data, 'name', 'B1'); % Please note 'name' from the first line above
such that the first page in an excel file contains first simulation results n the other pages contain the other simulation results as indicated by the user.
Please Help. Thx
My problem is that i want to save the final data from second simulation without having to go back to program n changing the same of the file to save. For Example;
Is it possible to do something like this!
name = input(' Please enter the simulation Name = ', 's' )
%data = contains all the simulated data
s = xlswrite('mydata.xls', data, 'simulation1', 'B1');
xlswrite('mydata.xls', data, 'name', 'B1'); % Please note 'name' from the first line above
such that the first page in an excel file contains first simulation results n the other pages contain the other simulation results as indicated by the user.
Please Help. Thx
I don't know about that software(xlswrite), but try using MATLAB for this purpose
I am using Matlab comand 'xlswrite' to execute a save to excel, so i am definately using matlab to do all the codind and simulation!
oh now i get ur question
try using for loop to get new file name e.g.
for i=1:10
s = xlswrite('mydata_i.xls', data, 'simulation1', 'B1');
P.S. correct the format