フィルターのクリア

Make this equation periodic (repeating every t_c seconds)

2 ビュー (過去 30 日間)
Hussam
Hussam 2024 年 3 月 27 日
コメント済み: Torsten 2024 年 3 月 28 日
Hi, how can I make the following equation periodic to repeat every t_c seconds, given that t_c > t_s. So for t_s<t<t_c the value of Q is zero.
Q=@(t)Q_peak*sin((pi*t)./t_s).^2.*(t<=t_s)
Thanks!
  2 件のコメント
Torsten
Torsten 2024 年 3 月 27 日
What is the interval you want to repeat periodically ? [0 t_s] ?
Hussam
Hussam 2024 年 3 月 28 日
That is the equation from [0 t_s], otherwise it is 0. I want this to be periodically repeated every t_c

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

採用された回答

Torsten
Torsten 2024 年 3 月 27 日
編集済み: Torsten 2024 年 3 月 28 日
Maybe like this:
Q_peak = 1;
t_s = 0.1;
t_c = 0.3;
fun = @(t)Q_peak*sin((pi*t)./t_s).^2.*(t>=0).*(t<=t_s);
F = @(t)fun(mod(t,t_c));
t = linspace( -0.6,0.6,2000);
plot(t,F(t))
  2 件のコメント
Hussam
Hussam 2024 年 3 月 28 日
Not exactly, I would like the function to include zero for some interval and then repeat, i.e. the sine curve for [0 t_s], zero for [t_s t_c], and repeat every t_c.
Torsten
Torsten 2024 年 3 月 28 日
Done.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by