I'm having difficulties trying to plot the reciprocal of a basic sine wave within MatLab. The tutorial I'm following (not a MatLab tutorial) is plotting it by hand by placing a few points between each vertical asymptote to give you an idea of what the graph will look like. I've tried using MatLab's csc()
function, and the graph when plotted along side x
is nothing like the drawn example. The drawn example from 0
to pi
looks similar to a big U
and from pi
to 2*pi
is a negative version (upside down). Here is all the different combinations of code I've tried:
x = 0:0.01:100;
y = 5*csc(x); % amplitude of -5 to 5
plot(x,y)
Then I tried:
x = 0:0.01:100;
y = 1 / 5*sin(x); % amplitude of -5 to 5
plot(x,y)
Both results are dramatically different. I was wondering if using the vector x
was okay as I was under the impression after one of my previous posts that the standard MatLab trig functions are setup to take radians rather than degrees?
Can you try this -
Is that what you expected?