MATLAB: How to plot function within a set of axis

functionplotting

I wrote a function code to calculate fStew. I have to plot the answer of the function within (pi,pi) but the graph is giving me blank? Here is what I wrote, fStew(theta)
ans =
-2.2737e-13
plot(fStew(theta))
I need it to be within (pi,pi) but my graph comes as blank.

Best Answer

It is because the output of the function is scalar. Try using a specified marker inside plot:
theta=pi/6;
plot(theta,fStew(theta),'o');set(gca,'XLim',[-pi pi])
Related Question