Instead of using linspace for such a simple example as this one, you can just define your vector X as an integer vector taking steps of 1, from 0 to 10:
X = 0:1:10;
Y = cos(3*pi/7*X);
Below shows the plot generated by the code snippet above (bottom plot) as well as the same plot using step size 0.5 (X = 0:0.5:10, top plot).
Note that as Adriaan notes in the comments below, the default step size for ... = from:stepsize:to notation is 1, i.e., if omitting the stepsize and simply writing ... = from:to, a step size of 1 is used by default (stepsize=1).
Asked in February 2016Viewed 3,304 timesVoted 6Answered 1 times