フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Question about fractional values.

1 回表示 (過去 30 日間)
Portgas Ace
Portgas Ace 2012 年 9 月 21 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Is there a way where i can separate a whole number from a fraction for example (5/3), is there a way to make it (5)(1/3)?
  1 件のコメント
Matt Fig
Matt Fig 2012 年 9 月 21 日
Do you have strings or what?
S = '(5/3)' % Like this?

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2012 年 9 月 21 日
use Symbolic Math Toolbox
x = sym('5/3');
[N,D] = numden(x);
out = [N,1/D];
  1 件のコメント
Portgas Ace
Portgas Ace 2012 年 9 月 21 日
solved my problem using [N,D] = rat(x). thanks though :D

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by