i need a Matlab function to generate a sinusoidal sequence,
Show older comments
<pre>
15 Comments
Aash
on 16 Oct 2017
KSSV
on 16 Oct 2017
Read about sin. What exactly is your question?
Aash
on 16 Oct 2017
Aash
on 16 Oct 2017
KSSV
on 16 Oct 2017
Read about Sin.it is a striaght forward attempt.
Walter Roberson
on 16 Oct 2017
Do you mean
x = A * sin(W0 + phi)
But what is the length N affecting? You kind of imply that it is affecting the length of the angular frequency, but you also say that angular frequency is given. Is it a starting angular frequency? If so then how far apart should the other angular frequencies be?
Aash
on 16 Oct 2017
Edited: Walter Roberson
on 16 Oct 2017
Walter Roberson
on 16 Oct 2017
Is that an implied multiplication between the w0 and the n?
A * sin(w0 * n + phi)
? If so then how is the n there intended to relate to "the desired length n" ?
What is supposed to be length n? n is the number of full cycles to show? n is to be the number of samples? n is to be the length in centimeters of the display on the graph??
Aash
on 16 Oct 2017
Walter Roberson
on 16 Oct 2017
What is supposed to be length n? n is the number of full cycles to show? n is to be the number of samples? n is to be the length in centimeters of the display on the graph??
Aash
on 16 Oct 2017
Walter Roberson
on 16 Oct 2017
That example plot violates the constraints given in the equation. In the equation, 0 < W0 < pi, but the example plot has W0 = 1.2 * pi
Aash
on 16 Oct 2017
Aash
on 16 Oct 2017
Walter Roberson
on 16 Oct 2017
I am not sure what you need me to do about this. Do you need me to call the person who set the assignment for you and point out to them that the question is wrong, that it clearly requires that w0 be less than pi, but also requires that w0 be 1.2 pi? If so then I will need to know their name and phone number and the times I can expect to reach them (and the time zone.) (Also, if I will need an interpreter, I will need to know that.)
Answers (1)
Walter Roberson
on 16 Oct 2017
stem(0:40,sqrt(3)*sin(1.2*pi*(0:40)+.3))
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!