Number formats in Matlab [not to use e symbol]

  • Context: MATLAB 
  • Thread starter Thread starter mech-eng
  • Start date Start date
  • Tags Tags
    Matlab Symbol
Click For Summary

Discussion Overview

The discussion revolves around formatting numerical outputs in Matlab, specifically the desire to avoid scientific notation (using the 'e' symbol) while maintaining a higher precision than what the 'bank' format offers. Participants explore various formatting options and potential custom solutions.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant expresses a need for a numerical format in Matlab that does not use the 'e' symbol while requiring more than two decimal places.
  • Another participant provides a link to Matlab's available formats and suggests that a custom formatter function might be necessary if the desired format is not listed.
  • A question is raised about whether the formatting concern pertains to command line display or writing to a file, indicating that the intended use may influence the formatting approach.
  • A further example is provided where a participant demonstrates a calculation in Matlab and discusses how setting the 'fix' format affects the display of results, suggesting a preference for a more readable scientific calculation format.

Areas of Agreement / Disagreement

Participants have not reached a consensus on a specific solution or format. Multiple viewpoints and approaches are presented, indicating that the discussion remains unresolved.

Contextual Notes

There are limitations regarding the specific formatting options available in Matlab and the potential need for custom solutions, which have not been fully explored or defined.

mech-eng
Messages
826
Reaction score
13
When I write 1.516*10^-5 in Matlab it gives 1.516000000000000e-05 but I do not want to use e symbol. So which format should I use. I could use format bank but it has only two digits. I need more digits. Would you like to help me.

Thank you.
 
Physics news on Phys.org
Here's a list of available formats:

http://www.mathworks.com/help/matlab/ref/format.html

Perhaps, you can tell us what format you're looking for.

In any event, if its not listed you might have to find a custom formatter function or write one yourself.

As an example, if you simply wanted to remove the 'e' from the notation you could convert the displayed number to a string and then adjust the string to replace the 'e' with a ' 10^'
 
Are you writing to a file, or are you wondering about command line display? And how would you like it to appear?
 
mfig said:
Are you writing to a file, or are you wondering about command line display? And how would you like it to appear?

For example: When I do this operation I want it to seem as in a handy scientific calculation with fix is set.
>> 648*0.05^4

ans =

0.004050000000000

>> ans/(128*0.800*40)

ans =

9.887695312500002e-07

When fix is set as 6

The result seems to be 0.000003.

Thank you.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K