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: How can I show the result of the fitting in text box?
Replies: 3   Last Post: Feb 14, 2013 9:49 AM

 Messages: [ Previous | Next ]
 Amr Sadek Posts: 9 Registered: 2/13/10
Re: How can I show the result of the fitting in text box?
Posted: Feb 14, 2013 3:55 AM

dpb <none@non.net> wrote in message <kfgn2p\$u4q\$1@speranza.aioe.org>...
> On 2/13/2013 8:42 AM, Amr Sadek wrote:
> > I have a GUI that fits some data with custom equations. I want to show
> > the result of the fitting process (the equation, the Coefficients and
> > the goodness of the fitting) on a text box in the GUI instead of the
> > MATLAB command window.
> > Thanks...

>
> How are you obtaining the coefficients, etc., ...?
>
> Instead of letting that output go to the command window, save it to
> appropriate variables and then use sprintf() and/or friends to format as
> desired as input to the text box.
>
> --

This is the main problem. I can't save it to variables. Here is an example;
-------------------------------------------------------------------------------------------------------------------
FIT2GOK =
General model:
FIT2GOK(T) = (no).*S.*exp(-E./(K.*T)).* (1+(b-1).*(S/R).*(((K.*T.^2./(E+
(2.*K.*T)))).*exp(-E./(K.*T)))-((K.*Ti.^2./(E+(2.*K.*Ti)
))).*exp(-E./(K.*Ti))).^(-b./(b-1))
Coefficients (with 95% confidence bounds):
E = 1.71 (1.707, 1.713)
S = 2.573e+13 (2.435e+13, 2.712e+13)
b = 1.261 (1.222, 1.299)
no = 579 (567.8, 590.2)
Problem parameters:
R = 3
Ti = 374
K = 8.617e-05
--------------------------------------------------------------------------------------------------------------------
The variable name is "FIT2GOK". I can't send this variable directly to the text box because of this error:
---------------------------------------------------------------------------------------------------------------------
Error using set
error: mxArray must be double, char, or cell
---------------------------------------------------------------------------------------------------------------------

Date Subject Author