exp-mantissa part alone

3 次查看(过去 30 天)
x
x 2011-9-11
x=4096; expx = large_exp(x) disp(expx);
how to get only the first part(mantissa part of the answer alone to find exponential and use it in program

采纳的回答

Walter Roberson
Walter Roberson 2011-9-11
x=4096; expx = large_exp(x); mantissa = expx(1);
  6 个评论
x
x 2011-9-12
sir where to use the format?why these mantissa values are different ?where to use format sir
Walter Roberson
Walter Roberson 2011-9-12
As the first executable line of your program, put
format long g
After that, you will not get those silly 1.0e+007 * displays, and you will be able to see why the mantissa showed up as 1.3375 instead of 0.000 .

请先登录,再进行评论。

更多回答(1 个)

the cyclist
the cyclist 2011-9-11
I am not sure what you mean by large_exp(). I assume it is a function you wrote, or maybe it is in a toolbox that I do not have. Regardless, I expect that you can get at what you need by using the floor() function.
  2 个评论
x
x 2011-9-11
inorder to calculate exp me used a function call and it gives expx =
1.0e+003 *
0.0074 1.7780 as my value for fimdimg exp(4096) the ans is the mantissa part alone ie)i want to get only 1.0e+003 *
0.0074 alone for this wt is to b done
x
x 2011-9-11
function expx = large_exp(x)
t = x/log(10);
expx = [10^(t-floor(t)), floor(t)];
this s the fuction pgm

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by