How To save the value of time when a condition is met
5 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am trying to save a value of time when a condition is met. the way I am currently implementing it is saving the array of time rather then the one value I require. My t is generated from a clock block in simulink.
% tM 1st instance of time when alpha1*alpha2 = 1
if (p.alpha1 * p.alpha2 == 1)&& (p.flag2 == 1)
p.tM =t;
p.flag2 = 0;
end
6 件のコメント
Mark McBroom
2022 年 9 月 11 日
You should not use a mux block. You should feed the digital clock block directly to the MATLAB Function block. Then, p.tM will be set to the current simulation time when the condition is true.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!