필터 지우기
필터 지우기

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