-1
y=cos(\theta);
plot(y);
axis([-pi pi -1 1]);

I'm new to Matlab and am trying to display theta, this way doesn't work. How would I display theta in a trig function? I just created a simple version but I will need to apply it to a more complicated version once I understand how to apply it.

  • This question has nothing to do with mathematics and belongs on another site. – David G. Stork Oct 12 '19 at 00:03
  • 1
    All math software except Mathematica is on-topic for this site. (Mathematica has its own group.) If you don't trust me, note the tag with 125 watchers and 2,700 questions. –  Oct 19 '19 at 10:44
  • Daryl's answer below is right.You can always find information (at least basic) about the functions of Matlab in its official webpage. – Gonzalo Benavides Oct 19 '19 at 11:50

1 Answers1

1

The plot function accepts two parameters. You can use plot(theta,y) to have the angle on the $x-$axis and the function value on the $y-$axis.

Daryl
  • 5,598