How to increment real world time in matlab function block of simulink?

2 次查看(过去 30 天)
Hi, I want to advance the complete system for n clk cycles or n samples(discrete constant sample period). Can I do this in matlab function block in simulink (simulink -> usr-defined-functions -> matlab function). Is this possible in matlab and simulink ?

回答(1 个)

Denis Gurchenkov
Denis Gurchenkov 2015-4-7
I don't think there is a way to "fast forward" the simulation time. However, you can achieve nearly same result by placing your blocks into a conditionally executed subsystem, and configure it so that the subsystem is not executed for the next N samples. Would this work for you?
  1 个评论
abc NP
abc NP 2015-4-7
Hi Denis, Now my quest changed in another way. I have a huge model, where I want to change inputs (and observe outputs) to that model dynamically every time-sample/time-step. Now, even changing that for so many times is also time-consuming and I want to reuse these changes. So I want to run simulink in command line using "sim" command. The funniest thing here is that the matlab command line is running the entire model at once for all time steps, and even if I give stopTime in sim command, later its not resuming from where it ended but starting simulation from the beginning. This is really very small functionality and makes a huge difference to the real time digital world. Can you please help me with these, or if there is no solution to this can you please recommend matlab in the next release to add the functionality to the command line. I have seen some solutions, but none of them works properly. For example, I saw a code in this link (<http://www.gomatlab.de/simulinkmodell-aus-matlab-heraus-simulieren-t23890.html)>, but it is not working. Could you please help with this.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by