Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: fit into str
Replies: 5   Last Post: Jan 23, 2013 10:33 AM

 Messages: [ Previous | Next ]
 itamar luzon Posts: 6 Registered: 5/7/12
Re: fit into str
Posted: Jan 23, 2013 10:13 AM

"Barry Williams" <barry.r.williamsnospam@saic.com> wrote in message <kdogm0\$t3u\$1@newscl01ah.mathworks.com>...
> "itamar luzon" wrote in message <kdo4lh\$j2v\$1@newscl01ah.mathworks.com>...
> > Hi,
> > does anyone know how to get the fittedmodel (fitresult) into string?
> > mean :
> > x=0:0.01:2*pi;
> > y=sin(x+rand(1,length(x))/2);
> > cftool(x,y); %I did a Fourier1 fit
> > fittedmodel =
> > % I want to get this data into text so i could show it on my figure in a textbox
> > General model Fourier1:
> > fittedmodel(x) = a0 + a1*cos(x*w) + b1*sin(x*w)
> > Coefficients (with 95% confidence bounds):
> > a0 = -0.0009963 (-0.009037, 0.007044)
> > a1 = 0.241 (0.2188, 0.2633)
> > b1 = 0.9605 (0.947, 0.974)
> > w = 1.003 (0.9968, 1.009)
> >
> > % and i don't wan't to write each field by it's own, I want all in one
> > % so I clould do it to other function as well
> >
> > thanks,
> > Itamar

>
> How about formatting using sprintf and then placing it on the figure using the text function?
> Barry

Hi Barry,
Thanks, but fittedmodel type is cfit and sprintf can't work with it.
Itamar

Date Subject Author
1/23/13 itamar luzon
1/23/13 Steven Lord
1/23/13 itamar luzon
1/23/13 itamar luzon
1/23/13 itamar luzon