Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Question about fractional values.

1 Ansicht (letzte 30 Tage)
Portgas Ace
Portgas Ace am 21 Sep. 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Matt Fig
Matt Fig am 21 Sep. 2012
Do you have strings or what?
S = '(5/3)' % Like this?

Antworten (1)

Andrei Bobrov
Andrei Bobrov am 21 Sep. 2012
use Symbolic Math Toolbox
x = sym('5/3');
[N,D] = numden(x);
out = [N,1/D];
  1 Kommentar
Portgas Ace
Portgas Ace am 21 Sep. 2012
solved my problem using [N,D] = rat(x). thanks though :D

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by