Hi, i am new to this site and I would hope to seek help on a coursera problem Consider the definition: function [s1, s2, sums] = sines(pts,amp,f1,f2). The input, pts, is an integer, but amp, f1, and f2 and are not necessarily integers. Output argument s1 is a row vector whose length (number of elements) equals pts. The elements of s1 are the values of the sine function when it is given equally spaced arguments that start at zero and extend through f1 periods of the sine. (Note that we ask for full periods, so if f1 is an integer, both the first and the last element of s1 will be 0 other than a very small rounding error.) The amplitude of the sine wave equals amp. The vector s2 is the same as s1 except that s2 contains f2 periods. The vector sums is the sum of s1 and s2. If f2 is omitted, then it should be set to a value that is 5% greater than f1. If f1 is omitted also, then it should be set to 100. If amp is not provided, then it should default to 1. Finally, if pts is omitted as well, then it should be set to 1000. For example, if you run sines without any input arguments and then you plot the third output argument, sums, the figure should look like this (if you stretch the plot window horizontally):

댓글 수: 3

Michael Haderlein
Michael Haderlein 2015년 5월 6일
편집: Michael Haderlein 2015년 5월 6일
I may refer to John's comment here.
To give you some start: Check the functions "linspace" and "nargin" (well, and "sin", obviously). If you struggle, show what the problem is in detail.
Brendan Hamm
Brendan Hamm 2015년 5월 6일
I might also add here that Coursera courses have forums for questions. This is meant so that you may discuss these problems with your peers and that they might be able to search for already answered questions easily. By posting this here you deny your peers that ability to search answered questions and often times even violate the course honor codes.
Brendan Hamm
Brendan Hamm 2015년 5월 6일
Furthermore, you never even asked a question. So what help do you want? Have you made any progress?

댓글을 달려면 로그인하십시오.

답변 (1개)

Ramesh kaka
Ramesh kaka 2019년 2월 10일

0 개 추천

Coursera courses have some amazing logic to solve these kind of problems

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2015년 5월 6일

답변:

2019년 2월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by