Plotting phase portraits for nonlinear systems is very much the same as for linear systems. You still can use "phaseplot.m" and just need to specify the nonlinear system in the function file, as done for the linear case. For example, to get the plot of the nonlinear damped pendulum shown in class (see figure below),
one simply needs to use the following function file (Courtesy of RMM):
function dxdt=damppend(t,x) g=1; l=1; b = 0.5; dxdt = [3*x(2); -g*l*sin(x(1)) - b*x(2)];