a small question of the sym

2 Ansichten (letzte 30 Tage)
xingyu
xingyu am 1 Apr. 2011
Hi I don't know how to get the numerical number after define sym. a simple code is shown as follows, how to get the value of m when x=1? Thanks
syms x n=sin(x^2); m=diff(n,x);
  1 Kommentar
Sean de Wolski
Sean de Wolski am 1 Apr. 2011
Well-written question; you get a vote!

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 1 Apr. 2011
double(m)
Edit:
You'll need to use subs to fill in the value:
subs(m,'x',1)

Weitere Antworten (1)

xingyu
xingyu am 1 Apr. 2011
But there is something wrong. do you mean:
x=1; n=double(n); m=double(m);
but it doesn't work
  1 Kommentar
Walter Roberson
Walter Roberson am 1 Apr. 2011
x = 1; double(subs(n))
OR
double(subs(n,x,1)) %without assigning to x

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by