using fprintf with scientific notation

조회 수: 130 (최근 30일)
Samuel Trinidad-Espinoza
Samuel Trinidad-Espinoza 2018년 2월 27일
답변: Voss 2023년 12월 26일
What commands can I use to get +1.01325E+05 and 3.381400e+01? I know it involves %E and %e but i don't know in what order i should use them in.

답변 (1개)

Voss
Voss 2023년 12월 26일
x = 101325;
y = 33.814;
fprintf('%+.5E',x)
+1.01325E+05
fprintf('%+.6e',y)
+3.381400e+01

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by