syms back to numbers
이전 댓글 표시
I am using syms to calculate equations with derivatives. I need to assign these syms number values to complete the analysis.
syms x y z
f=x^3 - 2 * y^4 + 4 * z^2
x=4
y=3
z=5
f=
답변 (1개)
Sean de Wolski
2014년 2월 4일
Use subs to substitute the values in:
syms x y z
f=x^3 - 2 * y^4 + 4 * z^2
subs(f,{x,y,z},{4,3,5})
And
댓글 수: 6
Philosophaie
2014년 2월 4일
편집: Philosophaie
2014년 2월 4일
Sean de Wolski
2014년 2월 4일
huh?
Please provide a minimal working example.
Philosophaie
2014년 2월 4일
Walter Roberson
2014년 2월 4일
There does not appear to be any "p" or "t" in your g_ ?
What values are you extracting for the variables, and what result do you get for the substitution, and what result are you expecting for the substitution ?
Philosophaie
2014년 2월 4일
Walter Roberson
2014년 2월 5일
What does Affinity look like before substitution? And please cross-check that rr, theta, phi, and tt are all scalars.
카테고리
도움말 센터 및 File Exchange에서 Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!