how can I use while loop in MAT-LAB function block within Simulink model

1 回表示 (過去 30 日間)
ahmed al-kady
ahmed al-kady 2015 年 9 月 12 日
編集済み: ahmed al-kady 2015 年 9 月 12 日
the required algorithm is to execute output signal value = 1 for every output port in sequence with time delay between each execution. the proposed code:
function [s1, s2, s3, s4, s5] = abs(f)
%#codegen
i=1; %iteration start
while f<=49.5
pause (1) %time delay
si = 1 %proposed output
end
i=i+1
end
but it didn't work include error ('Error using whileloopcode (line 4) Not enough input arguments.')

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by