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

3 ビュー (過去 30 日間)
abc NP
abc NP 2015 年 4 月 2 日
コメント済み: abc NP 2015 年 4 月 7 日
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 件のコメント
abc NP
abc NP 2015 年 4 月 2 日
Hi, Can anyone help me regarding this issue?

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

回答 (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 Center および File ExchangeSources についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by