I am trying to create an m-file function for a sine signal with input tmin, tmax, time-period, amplitude, but I don’t know how to to begin. I am a newbie with Matlab.
My Sine function has the following code
function y=sin(x)
y=sin(x);
In the command window, I type plot(mysine(x)); to get the sine signal, but this is all I know.
How do you set the tmin, tmax, time-period, amplitude ?
I want to have something like this
[x] = mysine(-10,10,0.25,2);
plot(x);
This is a very simple question which isn’t really to do with programming and I suspect it is homework.
if sine has the following form:
Basically what you are wanting to do is this:
which will produce something like this:
Which is the sine form you are looking for I believe.
As a function: