Change the expresion of the output of a matrix containing an exponential function

1 次查看(过去 30 天)
I'm taking an introductory matlab course and am working on quite a simple assignment, where I plot an exponential function (of remanining radioactive nucleides) against time and create a matrix containing the values for the first 10 days. C
The starting value for the exponential function is 10 000. The issue now is that matlab expresses both the days and the remaining nucleides against time. I would like it to instead display the values as they are (such as 0, 10 and 8300). How do I do that?
Here
x = log(2)/3.8;
N0 = 10000;
t = 0:1:10;
N = N0 * exp(-t*x);
M = [t ; N]
And here's my output:
M =
1.0e+04 *
0 0.0001 0.0002 0.0003 0.0004 0.0005 0.0006 0.0007 0.0008 0.0009 0.0010
1.0000 0.8333 0.6943 0.5786 0.4821 0.4017 0.3347 0.2789 0.2324 0.1937 0.1614
Is there a way to change the way it's expressed?

回答(1 个)

Alan Stevens
Alan Stevens 2021-3-31
Look up fprintf.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by