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: Question about 'subs'
Replies: 5   Last Post: Nov 11, 2012 8:20 PM

Advanced Search

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

Posts: 9
Registered: 10/20/12
Question about 'subs'
Posted: Nov 11, 2012 4:02 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello everyone,

For example, my function is x1^2*t^2 + x2^2*t^2+ .... + xn^2*t^2 + t^2, where n is any integer, I want to get the derivative wrt t at x1=1, x2=1, ..., xn=1, t=1.

For example, if n=2, f = x1^2*t^2 + x2^2*t^2 + t^2, I can use 'subs' to get the derivative
answer=subs(diff(f,t), {x1,x2,t}, {1,1,1}) .

However, since n is not fixed, how can I get the solution if n is very large, I cannot input
subs(diff(f,t), {x1,x2,x3.......x100}).

I tried
subs(diff(f,t), {x,t}, {zeros(1,100),1})
Does not work.

I will appreciate if anyone can give me some advice. Thanks.



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.