フィルターのクリア

How to use 'pause' function in Matlab Function Block?

2 ビュー (過去 30 日間)
Harshil Patel
Harshil Patel 2015 年 7 月 8 日
I'm able to run the following code in Matlab Command Window, which is giving me the output I'm looking for, i.e. printing the respective elements of matrix x and y after a three second gap:
x = [1 2 3];
y = [4 5 6];
x(1)
y(1)
pause(3);
x(2)
y(2)
pause(3);
x(3)
y(3)
However, I want a Matlab Function Block to process this code and display the answers in a 'display' block in Simulink. I set up the following model:
I'm able to run this code too, but the output is displayed in the Matlab Command Window (shown below), and not the 'display' blocks. Also, the code runs till the simulation time is over and this gives the required output multiple times. Is there any way to run the simulation only once?

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by