MATLAB: How to adjust the period of a sawtooth graph

graphperiodsawtooth

I found out there was a sawtooth function already built into Matlab but preset for a period of 2pi. I need to change it to 1. Is there a way to do that?

Best Answer

Hi Audrey, you want to have the sawtooth start over at x = 1, but the sawtooth function starts over when its argument gets to 2*pi. So take a look at
x = 0:.001:4;
y = sawtooth(2*pi*x);
plot(x,y)