MATLAB: Matlab won’t recognize “ln”

lnnatural logarithmplot

t=1:0.1:2; y=-1./ln(t+1); plot(t,y)
I'm trying to plot this function but I keep receiving this error. What could I be doing wrong?
Undefined function or variable 'ln'. Error in HW3_2_Actual (line 2) y=-1./ln(t+1);

Best Answer

In MATLAB (and a number of other programming languages), the natural logarithm function is log, not ‘ln’.