Exporting data sets to excel

I'm doing curve fitting.Firstly I read some data-sets from excel into matlab using xlsread.Then in the curve fitting toolbox I created some exclusion rules for the data sets.
I now want to bring these data sets (after creation of exclusion rules) to an xls file.
Please can anyonme advise how to do this please?

Risposte (2)

Tigersnooze
Tigersnooze il 7 Mar 2012
xlswrite is what you'll want to use. Correct usage can be found in the help, but I'll put it here for you:
xlswrite(filename, data, sheet, range)
So say you want to write matrix A to an excel file with the name myfile.xls, on sheet 1, starting at cell A1:
xlswrite('myfile.xls', A, 'Sheet 1', 'A1')
Keep in mind that if you just put 'A1', and say you have a 3x5 matrix, your data will be written to A1:C5. Sheet can either be a string with the name of the sheet, or an integer value for the sheet index.
Hope that helps.

9 Commenti

Shalini
Shalini il 7 Mar 2012
Tigersnooze,
I have done curve fit through the GUI.
In the command window I type,
X = xlsread('QS2T.xls',2,'A1:A10')
Y = xlsread('QS2T.xls',2,'B1:B10')
cftool
I get the dialog box.
I create exclusion rules for data sets
I do non linear curve fit using custom equation.
Now, the data sets with exlusion rules need to to excel
Will xlswrite work here?
Tigersnooze
Tigersnooze il 7 Mar 2012
Are those data sets with exclusion rules saved to new data sets? If so you can just export those new data sets to Excel using xlswrite.
Shalini
Shalini il 7 Mar 2012
How to do that?export those new data sets to Excel using xlswrite.
Tigersnooze
Tigersnooze il 7 Mar 2012
So call X1 and Y1 your new data sets. Use the code I mention in the original answer, but replace A with X1 to export X1, and Y1 to export Y1. Make sure to export them to separate ranges so you don't overwrite in the Excel file.
Shalini
Shalini il 7 Mar 2012
Are those data sets with exclusion rules saved to new data sets?
I dont find any option to do that..
Tigersnooze
Tigersnooze il 7 Mar 2012
I think if you hit the "Analysis" button, there's an option to export the data to the workspace.
Shalini
Shalini il 7 Mar 2012
I mean option to call X1 and Y1 my new data sets.
Shalini
Shalini il 7 Mar 2012
I think if you hit the "Analysis" button, there's an option to export the data to the workspace
That is only for predicted and independent data.I want the data set with which the fir is done to go to xls with exclusion.No option found yet!
Tigersnooze
Tigersnooze il 7 Mar 2012
Does the fit data come with a plot? You could always go old school and get the data directly from the plot to the workspace using get(gco, 'xdata') and get(gco, 'ydata'). That could be an option, I don't have much experience with cftool.

Accedi per commentare.

Srinivas
Srinivas il 7 Mar 2012

0 voti

doc xlswrite

4 Commenti

Shalini
Shalini il 7 Mar 2012
Can you pls elaborate? Please note I do not want the excluded data?
Srinivas
Srinivas il 7 Mar 2012
you need to give more details of your problem,
"I now want to bring these data sets (after creation of exclusion rules) to an xls file", is the data in base workspace
Shalini
Shalini il 7 Mar 2012
I have done curve fit through the GUI.
In the command window I type,
X = xlsread('QS2T.xls',2,'A1:A10')
Y = xlsread('QS2T.xls',2,'B1:B10')
cftool
I get the dialog box.
I create exclusion rules for data sets
I do non linear curve fit using custom equation.
Now, the data sets with exlusion rules need to to excel
Srinivas
Srinivas il 7 Mar 2012
I don't have curve fitting toolbox to look at, but looking at this page http://www.mathworks.com/products/curvefitting/description8.html, you can save the post processed signals to workspace and then write to excel

Accedi per commentare.

Richiesto:

il 7 Mar 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by