how to make piecewise continuous function periodic?

11 ビュー (過去 30 日間)
David
David 2014 年 11 月 20 日
コメント済み: Star Strider 2014 年 11 月 20 日
Hi, I have written this code for a piecewise continuous function for
f(x) = {2*sqrt(x) 0>=x>=1
{3-x 1>=x>=3
I am unsure how to make the function periodic with period 3 for all x? the code is:
f = @(x) ((2*sqrt(x)).*(and(0<=x,x<=1)) + (3-x).*(and(1<x,x<=3)));
x=0:0.01:3;
plot(x,f(x))
any help would be much appreciated! Thanks

採用された回答

Star Strider
Star Strider 2014 年 11 月 20 日
Are you and ‘john’ classmates by any chance?
I cannot in good conscience help him and not help you. See: How to plot a piecewise periodic function? Please Help.
Of course I would certainly encourage you to Accept this duplicate Answer as well!
  2 件のコメント
David
David 2014 年 11 月 20 日
Thanks for this :)
Star Strider
Star Strider 2014 年 11 月 20 日
My pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by