How to create a piecewise sine function?

1 回表示 (過去 30 日間)
Wes
Wes 2011 年 9 月 23 日
Hey all,
I am a trying to create an alternating sine wave of two seperate frequencies over a specified length of time. I have specified my 1 column of points in time and want to calculate the y(x) function/position.
I have my y(x)=sin(w*t)and y2(x)=sin(w2*t)functions, but am not sure how to create this piecewise wave? I am trying to use a for loop with if statements to do this , but I am finding this diffcult. How would you try to accomplish this?

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 9 月 23 日
Are the sine wave segments to be pieced together only on full-cycle boundaries, or is it necessary to match phase because one just leaves off and the other begins at the same point? Or if the boundary is not a full cycle, is it allowed for there to be a "glitch" in switching from the one to the other?

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by