Problem with the 2D-plot of a function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ronald Singer
am 16 Okt. 2017
Kommentiert: Ronald Singer
am 17 Okt. 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
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 16 Okt. 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')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Mining Geology finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!