MATLAB: Matlab plotting blank figures when equation features a log

figuresMATLABplotting

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?

Best Answer

LoL. You are trying to do all sorts of things that are of no value, when your problem was in not appreciating how to divide the elements of two vectors element-wise.
pdon is a vector. This is wrong;
Vdon=(Adon*pdon*ddon)/(log(pdon*ddon)+Bdon);
Instead, do this:
Vdon=(Adon*pdon*ddon)./(log(pdon*ddon)+Bdon);
what a difference a dot makes.
Much of MATLAB is oriented to array operations, which allow you to perform linear algebra efficiently. But if you only want to multiply or divide a list of numbers, you need to use the .* and ./ and .^ operators. As I said, you were looking for something complicated, in the form of opengl, hardware acceleration, etc. This was just basic arithmetic that was the problem. :)