geting answer in variable format , i want in number format.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
z = sym('2*x1 * x1 + x2*x2 + 3*x3*x3');
syms x1 x2 x3 ;
gradz = [diff(z,x1); diff(z,x2); diff(z,x3)];
x1(1)=2;
x2(1)=-2;
x3(1)=1;
%for k=2:5
p=subs(gradz, [x1 x2 x3], [x1(1) x2(1) x3(1)]);
I am getting answer in variable format,,,,,,i want in number format....so how i should get it?
0 Kommentare
Antworten (1)
Walter Roberson
am 24 Mär. 2013
If there are no remaining symbolic variables in p, then double(p) to get the double precision equivalent.
2 Kommentare
Siehe auch
Kategorien
Mehr zu Numbers and Precision finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!