Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Using partial derivatives in Matlab
Replies: 1   Last Post: Nov 26, 2012 10:38 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jagdish

Posts: 1
Registered: 10/11/12
Using partial derivatives in Matlab
Posted: Oct 11, 2012 12:24 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I am writing a code to implement a function with conditions that involve partial derivatives. The out put is going to be a 3*1 matrix and will involve partial derivatives with all the three parameters. Before I could implement the actual function, I was fiddling around with a simple function as described below with no success. Could you please have a look and let me know if I have made a mistake? I think I am making a rookie mistake that would be trivial to the expert eye. Thanks a lot in advance!

Code -

function resid=case2(x)

syms x1 x2

x1=x(1);
x2=x(2);

y=x1^2-5*x1*x2+3*x2^2;

resid=[diff(y,x1);diff(y,x2)];

end



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.