MATLAB: How to plot loglog(x,y) with an xlim and ylim

loglognegative data ignored

I am trying to graph using loglog(x,y), however I am running into problems with a Negative data ignored message. Here is some of my code:
xlim([1,1000000])
ylim([0.000000000001,0.00001]);
a= [2300*10^(-9), 223.0*10^(-9), 5.30*10^(-12), 20.0*10^(-12), 2.19*10^(-12)];
b=[8.7, 135, 3289, 51290,10219];
y= a(1).*exp(-x./b(1));
loglog(x,y,'b');
Thanks!

Best Answer

Christopher, move the xlim and ylim commands after the loglog command. Make sure that x > 0.