Matlab code for fractions
35 ビュー (過去 30 日間)
古いコメントを表示
How would I write 1.5/s as a num[ ] den[ ] code in matlab?
0 件のコメント
採用された回答
John D'Errico
2020 年 9 月 27 日
Confusing question.
Do you know the value of s?
s = 7
s =
7
>> 1.5/s
ans =
0.214285714285714
>> format rat
>> 1.5/s
ans =
3/14
Do you not know what is is, so you want to use s in a symbolic form?
syms s
1.5/s
ans =
3/(2*s)
2 件のコメント
John D'Errico
2024 年 11 月 26 日
編集済み: John D'Errico
2024 年 11 月 26 日
syms s
F = 1.5/s
[N,D] = numden(F)
N =
3
D =
2*s
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!