필터 지우기
필터 지우기

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.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by