periodic symbolic matlab function

5 ビュー (過去 30 日間)
Youssef
Youssef 2014 年 5 月 21 日
コメント済み: Walter Roberson 2014 年 5 月 22 日
say I want to make a symbolic function (I mean a function of a symbolic variable x), but it's periodic. Imagine a rectangle that repeats itself along the x axis. But I want it symbolic, not in function of an array x. How to implement it? I can use a for loop but the loop is limited! And there is no such thing as "for i=1:inf"

回答 (2 件)

Walter Roberson
Walter Roberson 2014 年 5 月 22 日
xm = mod(x,AppropriatePeriod);
and then use xm instead of x in your formula

Youssef
Youssef 2014 年 5 月 22 日
can you please write down a couple of lines code using mod and ezplot?
  1 件のコメント
Walter Roberson
Walter Roberson 2014 年 5 月 22 日
Take the implicit example
ezplot('x^2-y^4')
and modify to
ezplot('mod(x,8)^2-y^4')
to get it to repeat every 8

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

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by