Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I stop the recompile of the model after first run to quicken the simulation time ?

1 回表示 (過去 30 日間)
Karim Gamal
Karim Gamal 2020 年 5 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am making a game using unity and I have a simulink model that recieves cooridinates and sends data from which the unity "player" moves. and as figures this needs simulink to be very quick in simulating the model and giving the output so that it can nearly sync with unity.. but the problem is simulink simulation is slow..
I update parameters using set_param then use sim function to run the simulation with the new parameters but each time takes around 2.5 3 secs which causes a response delay to unity thus incorrect/delayed motion in unity.
I tried using model reference and running the model in accelerator mode which seemed to cause the same issue..
so is there any possible way to eliminate this delay.. it should be atleast less than a second to make the motion the least good.
here's the part responsible in my matlab code:

回答 (1 件)

Mark McBroom
Mark McBroom 2020 年 5 月 14 日
  1. make the parameters for INputX and InputY to be tunable workspace parameters. https://www.mathworks.com/help/xpc/ug/tuning-block-parameters-and-model-parameters.html
3. Alternately, you should be able to switch model to accelerated mode, and it should not recompile model when you change the tunable parameter.

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by