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!