How can i reduce the powers of all plotted functions to 0

2 次查看(过去 30 天)
Let's say I am calculation different functions, which converge to a certain value, depending on a Value - N that I regulate. I want to plot these function in the same graph.
My problem is that the function is based on the determinant of a Matrix, it recieves very big values if i increase my value N. That's why I want to keep the function ratio, but reduce all the powers to 0, showing the relationshow between each function in the same graph.
If I don't change the power to 0, it looks like this for all plotted functions:
N=1-7.png
For the first value I plot it looks like this:
N=1.png
and for the second value I plot, like this:
N = 2.png
and so on...
To sum it up - The problem is that my plotted functions gradially become bigger, when the value of N increases, which, when comparing all of them in the same graph, makes all but one function look like a straight line. This is why I want to change the power of the function, to 0 to match the first graph (N=0) but still keep the ratio of the function.
  2 个评论
Emil Nilsson
Emil Nilsson 2019-10-19
The power of the functions depend on the determinant value of the Function matrix I calculate. SInce the determinant value quickly rises to very high numbers, given a higher number of N, the functions are not comparable in a graph. Given that, I have not called the power of a function anything, it is simply a recieved value eg. 10^134 in the combined graph, and 10^2 in the first one.
What I want to do, is implement a code that, divides the given values, with its power, eg.
if N = 32 is 10^134, I want to divide all values in that function with 10^134, and if
N = 2 is 10^2, I want to divide all values in that function with 10^2.

请先登录,再进行评论。

回答(1 个)

Stephan
Stephan 2019-10-19
编辑:Stephan 2019-10-19
one approach using string arrays:
number = exp(100)
a = split(string(sprintf('%e',number)),"e+");
b = double("1e+" + string(a(2)));
result = number/b

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by