MATLAB: Graph looks like a dotted straight line

curve fittingCurve Fitting ToolboxgraphgraphicsMATLAB C/C++ Graphics Librarynonlinear

I need a exponential curve. but it looks like a horizontal dotted line. how could I get it?
u=0.01; i=22/7; g=716; l=0.1;
d=50; p=45; r=linspace(0,1,100);
m=tand(p)
a=(r-m*(d+l)).^-2-((r-m*l).^-2)
q=(i*r.^4*g)/(8*u*l)
tl=(2*u*q.*a)./(i*m)
tb=(i*m*tl)/(2*u*q.*a)
plot(r,tb)

Best Answer

tb=(I*m*tl)./(2*u*q.*a) % is equivalent to (I*m*(2*u*q.*a))/(I*m*2*u*q.*a))
so everything gets cancelled out , you will have a question why the first value of tb is NaN because when you divide zero by zero in matlab you get a NaN ( https://www.mathworks.com/help/matlab/ref/nan.html#f91-998317 )