Matlab plotting blank figures when equation features a log
显示 更早的评论
I'm trying to generate a plot of the following equation:
Adon=4.36e7;
Bdon=12.8;
pdon=(0.5:5);
ddon=1e-3;
Vdon=(Adon*pdon*ddon)/(log(pdon*ddon)+Bdon);
plot(pdon,Vdon);
But when I run that, I get a blank figure. No data in the function at all.
In the same .m file, I am able to successfully plot the following:
p=(760:1000);
d=0.1;
T1=273;
B=365;
A=15;
C=1.18;
conch1=293*p*d/(760*T1);
Vb1 = 24.22*conch1+6.08*sqrt(conch1);
plot(p,Vb1);
The only difference seems to be the Log function in the denominator of the former code, but it strikes me as unlikely that Matlab would be unable to plot a log function. It's able to calculate results for discrete values of pdon, but it is not plotting anything.
I have tried focing opengl to use software acceleration, and forcing it to use hardware acceleration. Neither worked.
I have tried commenting out everything but the first bit of code that shouild plot Vdon, and it still returns a blank figure.
I'm new to Matlab, so if there's something that I'm missing I'd be pleased to learn it. Why is the first equation returning a blank figure, but the second equation works as expected. How can I fix it?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!