Xu
Posts:
9
Registered:
10/20/12


Question about 'subs'
Posted:
Nov 11, 2012 4:02 PM


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.

