MATLAB Answers

save values of variable

3 views (last 30 days)
fereshte
fereshte on 4 Jun 2014
Commented: fereshte on 4 Jun 2014
hi.i run a code and give me a variable. i click it and dont show me any value.but when i type in work space and press enter give me values. why? how save the values?
my variable is fittedmodel1 and attached it.
thank you

  0 Comments

Sign in to comment.

Accepted Answer

Roger Wohlwend
Roger Wohlwend on 4 Jun 2014
The variable fittedmodel1 is a class. You cannot double-click on class variables and see what is inside. You have to use the workspace for that. To save the values just save the variable. Or extract the values and save them in a different variable.

  4 Comments

Show 1 older comment
fereshte
fereshte on 4 Jun 2014
>> fittedmodel1
fittedmodel1 =
General model Gauss8:
fittedmodel1(x) =
a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2) +
a3*exp(-((x-b3)/c3)^2) + a4*exp(-((x-b4)/c4)^2) +
a5*exp(-((x-b5)/c5)^2) + a6*exp(-((x-b6)/c6)^2) +
a7*exp(-((x-b7)/c7)^2) + a8*exp(-((x-b8)/c8)^2)
Coefficients (with 95% confidence bounds):
a1 = 11.79 (-25.14, 48.73)
b1 = 24.23 (23.1, 25.36)
c1 = 1.269 (-0.9108, 3.448)
a2 = 5.997 (-2754, 2766)
b2 = 31.62 (-42.47, 105.7)
c2 = 0.557 (-183.4, 184.6)
a3 = -128.5 (-2.117e+005, 2.114e+005)
b3 = 36.55 (-2138, 2211)
c3 = 4.403 (-433.9, 442.7)
a4 = 144.7 (-2.116e+005, 2.119e+005)
b4 = 35.59 (-255.2, 326.4)
c4 = 3.91 (-439, 446.9)
a5 = 513.9 (-9.874e+005, 9.884e+005)
b5 = 30.21 (-306.9, 367.3)
c5 = 6.427 (-199.9, 212.7)
a6 = 9.715 (-717.2, 736.6)
b6 = 30.31 (6.772, 53.86)
c6 = 1.819 (-44.63, 48.27)
a7 = -469.9 (-9.996e+005, 9.986e+005)
b7 = 30.48 (-114.3, 175.2)
c7 = 6.14 (-440.2, 452.5)
a8 = 58.28 (-4016, 4133)
b8 = 39.29 (16.41, 62.17)
c8 = 2.707 (-19.83, 25.25)
Roger Wohlwend
Roger Wohlwend on 4 Jun 2014
Save the variable fittedmodel1, not the single coefficients, because you need the class to interpolate, plot or whatever. You can access the coefficients with fittedmodel1.a1, fittedmodel1.b1, ....
fereshte
fereshte on 4 Jun 2014
how save coefficients?

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags