Expanding a number in matlab and getting rid of e+003 how ?

In summary, to expand a number in Matlab, you can use the format function with the long option to display up to 15 digits. To get rid of e+003 notation, use the format function with the short option. You can also specify the number of digits to display by using the format function with the longG option. To prevent automatic conversion to scientific notation, use the format function with the shortEng option. If you encounter an error when expanding large numbers, you can use the vpa function for variable-precision arithmetic.
  • #1
uaeXuae
54
0
[SOLVED] Expanding a number in MATLAB and getting rid of e+003 how ?

heres my code:

Sysms x
f=(my function)

Y=int(f,11,16) --> Results in a fraction answer

Double(y) --> To get rid of the fraction

The answer is 1.6050e+003

how do i let it show 1605 straight away ?
 
Physics news on Phys.org
  • #2
Anyone please ? I have to submit this in 2 days please help...
 

1. How do I expand a number in Matlab?

To expand a number in Matlab, you can use the format function, followed by long, which will display the result in long format with up to 15 digits.

2. How do I get rid of e+003 in Matlab?

You can use the format function with the short option to get rid of the e+003 notation in Matlab. This will display the number in a shorter format with no scientific notation.

3. Can I change the number of digits displayed when expanding a number in Matlab?

Yes, you can use the format function with the long option and specify the number of digits you want to display. For example, format longG will display the number in long format with up to 15 significant digits.

4. How do I prevent Matlab from automatically converting numbers to scientific notation?

You can use the format function with the shortEng option to prevent Matlab from automatically converting numbers to scientific notation. This will display the number in a shorter format with no scientific notation.

5. Is there a way to expand large numbers in Matlab without getting an error?

Yes, you can use the vpa function to expand large numbers in Matlab without getting an error. This function uses variable-precision arithmetic to handle numbers with a large number of digits.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
804
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
940
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
687
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Back
Top