Using Solve function but it keeps returning an answer without variables

I am trying to get MATLAB to solve for v from a Kinetic Energy Equation using the solve function. Prior I had kept getting the response 0 0 in a collum. The current code produces a different output but still not the solution for v in terms of the other variables.
>> Kin = str2sym('KE = 0.5*m*v^2')
Kin =
KE == 0.5*m*v^2
>> syms KE m v
>> solve(KE,v)
ans =
Empty sym: 0-by-1

 採用された回答

VBBV
VBBV 2023 年 7 月 19 日

0 投票

syms m v
solve(Kin,v)

2 件のコメント

VBBV
VBBV 2023 年 7 月 19 日
Try the above , it seems you declare the KE as symbolic variable which is not necessary . The equation is represented by Kin in symbolic terms which needs to be input for solve function.
Nathan
Nathan 2023 年 7 月 19 日
Yes, I got it thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2023 年 7 月 19 日

コメント済み:

2023 年 7 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by