a small question of the sym
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Respuesta aceptada
Sean de Wolski
el 1 de Abr. de 2011
double(m)
Edit:
You'll need to use subs to fill in the value:
subs(m,'x',1)
0 comentarios
Más respuestas (1)
xingyu
el 1 de Abr. de 2011
1 comentario
Walter Roberson
el 1 de Abr. de 2011
x = 1; double(subs(n))
OR
double(subs(n,x,1)) %without assigning to x
Ver también
Categorías
Más información sobre Symbolic Variables, Expressions, Functions, and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!