I am trying to plot a log equation, before I can I need to calculate x.
x can sometimes be returned as 0 or 1 so I need to exclude these points before I plot the log graph.
How do I achieve this?
So far I have tried this fairly inefficient way, and it doesnt seem to be excluding them from the array just not plotting them on the graph so that when i get to the last function to calculate p it doesnt calculate it for the whole array just one value:
xi1 = hits1./tot1yi1=log(xi1./(1-xi1));xplot1 = xi1yplot1 = yi1;xplot1(xplot1==0) = NaN;yplot1(yplot1==0) = NaN;xplot1(xplot1==1) = NaN;yplot1(yplot1==1) = NaN;xplot1(xplot1==-Inf) = NaN;yplot1(yplot1==-Inf) = NaN;xplot1(xplot1==Inf) = NaN;yplot1(yplot1==Inf) = NaN;figure(1)plot(xplot1, yplot1,'linestyle','none','marker','o')hold onp1 = 4.8422;p2 = -2.4067;y = (p1.*xi1) + p2plot(xi1, y)hold offp = 1/(1+exp(-((p1.*xi1) + p2)))figure(3)plot(xi1, p)
Best Answer