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 个)

You can use the block If-Then-Else Blocks

5 个评论

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?
Where did you put this function? There is no start time and stop time for each block
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.
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

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Simulink 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by