Problem with the 2D-plot of a function

조회 수: 1 (최근 30일)
Ronald Singer
Ronald Singer 2017년 10월 16일
댓글: Ronald Singer 2017년 10월 17일
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

채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 16일
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')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mining Geology에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by