필터 지우기
필터 지우기

how to change matlab answers type?

조회 수: 3 (최근 30일)
arian hoseini
arian hoseini 2021년 12월 29일
댓글: arian hoseini 2021년 12월 30일
i have a problem with matlab answers ...it always shows answers like this
(200*6151^(1/2))/3 - 14200/3
how can i fix that?i mean is there a setting or code for it?i tried double but it also show it like 4.952207476509866e+02 i want the answer like this 495.22

채택된 답변

Image Analyst
Image Analyst 2021년 12월 29일
format longG
% or
format shortG

추가 답변 (1개)

KSSV
KSSV 2021년 12월 29일
편집: KSSV 2021년 12월 29일
  댓글 수: 2
Steven Lord
Steven Lord 2021년 12월 29일
The format function will work once the symbolic answer has been converted to double precision using double, but you could use vpa instead (especially if the symbolic answer cannot be converted to double because it includes a symbolic variable.)
y = (200*sym(6151)^(1/2))/3 - sym(14200)/3
y = 
d = double(y)
d = 495.2207
format long
d
d =
4.952207476509858e+02
vpa(y, 6)
ans = 
495.221
arian hoseini
arian hoseini 2021년 12월 29일
thank u

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

태그

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by