Wednesday, September 28, 2005

How to use subs in Matlab

clc;
close all;

syms x1 x2 x3
a='(x1^2+(x2+1)^2)*(x1^2+(x2-1)^2)';

l1=diff(a,x1);
l2=diff(a,x2);
l1=subs(l1,x1,1);
l1=subs(l1,x2,1)
l2=subs(l2,x1,1);
l2=subs(l2,x2,1)

0 Comments:

Post a Comment

<< Home