Change specific simulation time in Simulink

Hello,
I have been working on a simulink model and the simulation works perfectly.
I wanna add a new block to the simulation, which only runs for a specific time. So lets say I run the simulation for 10000s, I only want the new block to run from 2000-4000.
Is this possible? And is there a way I can make a specific block start after some seconds?
Your Sincerly

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 13 日

0 投票

You can use the block If-Then-Else Blocks

5 件のコメント

Kelvin
Kelvin 2014 年 7 月 13 日
But I tried to put a variable called simulation_stop_time and im changing that variable in a matlab script. But how do I access this simulation time while it runs? I tried to make a matlab function like this:
if simulation_stop_time > 1000
signal_out = 1
else
signal_out = 0
end
But since I gave this variable a value, it doesnt change. But how do I access the variable that goes from 0 - simulation_stop_time?
Aint it possible to use this value somehow?
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 13 日
Where did you put this function? There is no start time and stop time for each block
Kalle
Kalle 2014 年 7 月 13 日
I put it in simulink. I can't really see how I can explain it better. It should be a basic question.
Let's say I put a transfer function in a model and run it for '' 10000'' and put a scope to see the output. Now I want to add a disturbance that should only run for 1000-2000. Is this possible? I want to access the increasing simulation time.
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 13 日
When there is no disturbance signal, we can consider it as equal to zero. Instead of telling: I will run a disturbance from 1000 to 2000, just set your disturbance signal to zero wherever you want
Omar Al-Khatib
Omar Al-Khatib 2021 年 1 月 22 日
Haha LOL gud answer :)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

製品

タグ

質問済み:

2014 年 7 月 13 日

コメント済み:

2021 年 1 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by