how to avoid powers of 10 i.e 1.0e+03 in answers

243 次查看(过去 30 天)
Hello, every time when i done calculation matlab giving answers 1.0e+03 * [ vector]. how to avoid this..??? few times its useful but few times it troubles me.

采纳的回答

Walter Roberson
Walter Roberson 2015-6-5
编辑:Walter Roberson 2015-6-5
"format short" or "format long". See also your Preferences -> Command Window Preferences, as the default can be set there.
  6 个评论
Stephen23
Stephen23 2018-5-30
@Maximilian Arpaio: the format is a property of the command window. It affects how numeric values are displayed in the command window. You can set the format and then after that all numbers will be displayed using the format that you selected, until you change it again. The format is not a property of projects or functions (although it might be set by them).
sudhir keshari
sudhir keshari 2021-5-8
Thank you so much for giveing these command, this is very useful, when other operations are applied on these numbers.

请先登录,再进行评论。

更多回答(3 个)

Wagih Abu Rowin
Wagih Abu Rowin 2018-6-19
Use
format shortG
>> 1.0e+03
ans =
1000
  1 个评论
Josh La Palma
Josh La Palma 2018-10-20
Far out, thank you my man! It's seriously irritating enough then I tend to use symbolab instead of matlab

请先登录,再进行评论。


Sren Seyha
Sren Seyha 2020-4-9
How avoid exponnetial number in my matlab gui interface:
  1 个评论
Walter Roberson
Walter Roberson 2020-4-9
If you are looking at the variable browser, then you can use Preferences -> Variables -> Default array format to change to a different format for the variable browser. For values that are being output by disp() or implied disp() to the command window then Preferences -> Command Window -> Text Display -> Numeric Format sets the "format" command that is done for you when you start MATLAB.
If you are talking about numeric data that is entered into a uitable(), then the only control you have is to set the ColumnFormat property for the column to one of the format types such as 'longg' . However you cannot use a standard format specification such as %0.7f . If you need that level of control, then best is to sprintf() or sprintfc() or compose() to convert the numbers to character vectors or string objects and set that into the uitable.
If you are talking about numeric data that you are setting as a String property of a uicontrol listbox or popup, then use sprintf() or sprintfc() or compose() to format it before setting it as the String property.

请先登录,再进行评论。


Muhammad Norman Hakeem bin Ramlee
Hi my script is this
n=[1.5,3.4;91250,73000]
but it comes out as
n =
1.0e+04 *
0.0001 0.0003
9.1250 7.3000
the 1.0e+04 * automatically comes out of nowhere and disturbs my data all the time. Anyone knows why?

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by