MATLAB: Graph keeps coming up blank

2d plotblankblank plotfor looploopplot

Hello, this is the code I have. Every time I try to run it it gives me a blank figure. Do I need to use a for loop? If so, how should I do that?
T=[3000:30000]; gratio=4; deltaE=1.63e-18; k=1.38e-23;
nratio=gratio.*exp(deltaE./k.*T); %Boltzmann excitation formula
plot(T,nratio, 'r')
xlabel('Temperature (K)','fontsize',18, 'FontWeight','bold')
ylabel('Number of Atoms Ratio','fontsize',18, 'FontWeight','bold')
title('Boltzmann Excitation Formula as it Varies with Temperature','fontsize',18, 'FontWeight','bold')

Best Answer

I had to search on the Boltzmann Excitation Formula to be sure, but I believe this is what you want:
nratio=gratio.*exp(deltaE./(k.*T));
The product (k.*T) is supposed to be in the denominator. (You were calculating deltaE./k and then multiplying it by T. It was returning Inf for nratio.)
Note: You might consider semilogx, semilogy or loglog for your plot.