MATLAB Answers

kyin gab

How to make this a real number

Asked by kyin gab
on 30 Nov 2012

Hello,

My MatLab code outputs this 1.3357e+03 and I think this can be converted to a number like 1335.7.

I would like the MatLab function that will help me convert it.

Thanks for your help.

  0 Comments

Products

3 Answers

Answer by Azzi Abdelmalek
on 30 Nov 2012
 Accepted answer
 x=1.3357e+03;
 out=sprintf('%.1f',x)

  1 Comment

kyin gab
on 30 Nov 2012

Azzi, Matt, Walter Jurgen, thanks guys


Answer by Jurgen
on 30 Nov 2012

sprintf?

  0 Comments


Answer by Walter Roberson
on 30 Nov 2012
format long g

  1 Comment

Matt Fig
on 30 Nov 2012

Even

format short g

gets it.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today