From: Sander on
I have a simple question with possibly a difficult answer.

The new symbolic toolbox of matlab seems very powerful. One of the uses is to differentiate functions. Subsequently it should be possible to use the differentiated functions as normal numerical functions, but my question is how. I want to use these equations to build up a Jacobian matrix.

So I'm searching for example:
f=x^2
symbolically: df/dx=2*x
go back to numeric (HOW?!)
J=2*x

Admittedly, the example is bad, but I hope the idea is clear. If someone could halp me out, I'll be very happy :-)
From: Sander on
By the way, I know that you can make the symbolic Jacobian by simply using the function 'jacobian', but still need to know how to use the symbolic evaluation as 'text' to use as a 'numerical jacobian'.

Thanks in advance,
Sander
From: Alan Weiss on
On 7/28/2010 7:34 AM, Sander wrote:
> By the way, I know that you can make the symbolic Jacobian by simply
> using the function 'jacobian', but still need to know how to use the
> symbolic evaluation as 'text' to use as a 'numerical jacobian'.
>
> Thanks in advance,
> Sander

Take a look at some examples in Optimization Toolbox documentation:
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brn4nh7.html#brv_i_1
http://www.mathworks.com/products/optimization/demos.html?file=/products/demos/shipping/optim/symbolic_optim_demo.html

Alan Weiss
MATLAB mathematical toolbox documentation
From: Steven_Lord on


"Sander " <s.a.tromp(a)tudelft.nl> wrote in message
news:i2p3r0$3vb$1(a)fred.mathworks.com...
> I have a simple question with possibly a difficult answer.
>
> The new symbolic toolbox of matlab seems very powerful. One of the uses is
> to differentiate functions. Subsequently it should be possible to use the
> differentiated functions as normal numerical functions, but my question is
> how. I want to use these equations to build up a Jacobian matrix.
>
> So I'm searching for example:
> f=x^2 symbolically: df/dx=2*x
> go back to numeric (HOW?!)
> J=2*x
>
> Admittedly, the example is bad, but I hope the idea is clear. If someone
> could halp me out, I'll be very happy :-)

Use MATLABFUNCTION.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com