rounding the imaginary part of the number

20 Ansichten (letzte 30 Tage)
Luccas S.
Luccas S. am 15 Jul. 2021
Beantwortet: Alan Stevens am 15 Jul. 2021
Z1 =
0.0000e+00 + 7.8765e-04i
I would like the result to appear as 0.0008i in the imaginary part, how to do this?

Akzeptierte Antwort

Alan Stevens
Alan Stevens am 15 Jul. 2021
Z = 0.0000e+00 + 7.8765e-04*1i;
format shortG
round(Z,4)
ans =
0 + 0.0008i

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by