Create a continous stepwise increase in Simulink

조회 수: 15 (최근 30일)
Andreas Skovhøj
Andreas Skovhøj 2020년 6월 6일
댓글: Ameer Hamza 2020년 6월 6일
Hi!
Is there any way to create a stepwise increase in Simulink using parameters (a,b,c) which can be chosen from a MATLAB script. I have tried using the step function which does not work, and the signal builder which is not good as i would to change parameters from my MATLAB script. What i want is the following variable f(t) to do the following determined by the parameters a,b and c.
Any help is appriciated.
BR
Andreas

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 6월 6일
You can use the MATLAB function block and a clock to create this signal as shown in the image
The code inside the MATLAB function block is
function y = fcn(t)
a = 5;
b = 2;
c = 3;
t = t - a;
y = 0;
if t > 0
y = ceil(t/c)*b;
end
  댓글 수: 2
Andreas Skovhøj
Andreas Skovhøj 2020년 6월 6일
wow. thanks!
Ameer Hamza
Ameer Hamza 2020년 6월 6일
I am glad to be of help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by