Problem with the 2D-plot of a function

1 visualización (últimos 30 días)
Ronald Singer
Ronald Singer el 16 de Oct. de 2017
Comentada: Ronald Singer el 17 de Oct. de 2017
Hello everybody,
i tried to plot a function. In it's final form, the only parameter of this function is "x".
When i try to plot this function, i get an error. Can you guys tell me where the problem is?
So lets say this is my function:
Varg_hat =
(1497527781869391849*x^2*exp(2*(-x*exp(-41/10))^(9/5))*exp(-41/5)*(-x*exp(-41/10))^(8 /5))/720575940379279360 + (232324954970675913*x*exp(2*(-x*exp(-41/10))^(9/5))*exp(-41/10)*log(-x*exp(-41 /10))*(-x*exp(-41/10))^(13/5))/720575940379279360
Now i want to plot this, by calculating this function for x-values from lets say 0 to 350 in 0.1-steps.
How can i do this?
I tried for example:
x=0:0.1:350;
plot(x,Varg_hat)
But then Matlab says:
Error using plot
Data must be numeric, datetime, duration or an array convertible to double.
Thank you for taking time to look over my question.
Sincerly, Ronald Singer

Respuesta aceptada

Walter Roberson
Walter Roberson el 16 de Oct. de 2017
syms x;
Varg_hat = (1497527781869391849*x^2*exp(2*(-x*exp(-41/10))^(9/5))*exp(-41/5)*(-x*exp(-41/10))^(8 /5))/720575940379279360 + (232324954970675913*x*exp(2*(-x*exp(-41/10))^(9/5))*exp(-41/10)*log(-x*exp(-41 /10))*(-x*exp(-41/10))^(13/5))/720575940379279360;
x=0:0.1:350;
y = double(subs(Varg_hat));
plot(x,real(y),'k', x,imag(y),'r')

Más respuestas (0)

Categorías

Más información sobre Mining Geology en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by