a small question of the sym

조회 수: 2 (최근 30일)
xingyu
xingyu 2011년 4월 1일
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
Sean de Wolski
Sean de Wolski 2011년 4월 1일
Well-written question; you get a vote!

댓글을 달려면 로그인하십시오.

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 4월 1일
double(m)
Edit:
You'll need to use subs to fill in the value:
subs(m,'x',1)

추가 답변 (1개)

xingyu
xingyu 2011년 4월 1일
But there is something wrong. do you mean:
x=1; n=double(n); m=double(m);
but it doesn't work
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 4월 1일
x = 1; double(subs(n))
OR
double(subs(n,x,1)) %without assigning to x

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Symbolic Variables, Expressions, Functions, and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by