Matlab code for fractions
35 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Johnny McKenney
il 27 Set 2020
Modificato: John D'Errico
il 26 Nov 2024
How would I write 1.5/s as a num[ ] den[ ] code in matlab?
0 Commenti
Risposta accettata
John D'Errico
il 27 Set 2020
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 Commenti
John D'Errico
il 26 Nov 2024
Modificato: John D'Errico
il 26 Nov 2024
syms s
F = 1.5/s
[N,D] = numden(F)
N =
3
D =
2*s
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!