Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using m code generated by curve fitting tool box
Date: Tue, 2 Dec 2008 19:22:02 +0000 (UTC)
Organization: Univ of Waikato
Lines: 11
Message-ID: <gh41sq$457$1@fred.mathworks.com>
References: <gh2hpd$av5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228245722 4263 172.30.248.38 (2 Dec 2008 19:22:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 2 Dec 2008 19:22:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 743752
Xref: news.mathworks.com comp.soft-sys.matlab:504466


"Pawan " <pawan@waikato.ac.nz> wrote in message <gh2hpd$av5$1@fred.mathworks.com>...
> Hi, I need a big help to extract the information generated by the m-file generated by curve fitting tool box. I used "xdata" and "ydata" and fitted it into a sine wave using curve fitting tool box. I used "Sum of Sin functions" as type of fit and "a1*sin(b1*x+c1)" as type of sin functions. Then it generated a sine wave for me and I saved it as m-file. Now I am using it as the function of my main code to do the curvefitting. But I want to extract the values a1, b1 and c1 generated by that function(m-code). It is saved as "cf_" under the automatically generated variable of m code which I can see in the workspace but it is not in 1-D or 2-D array, rather it comes up with text meassage in the workspace (in the class field of workspace it is written "cfit" which is normally "double" for other variables) so I cannot store it in other variables for further processing using the codes in the program. Is it possible to extract that information? 
> Also is there any command for sinusoidal fitting similar to "polyfit" or "poly3"(which are used for polynomials)?



Hi Jiro,

I tried your suggestion and it worked. Hurray. You are genius. Thank you so much.

Pawan