Rapid Accelerator tunable parameters mapping structure remains empty after build

조회 수: 5 (최근 30일)
Marvin
Marvin 2016년 11월 17일
답변: Tong Zhao 2022년 2월 16일
I am trying to to learn how to tune parameters of a rapid accelerator model that I want to build. For starters I followed Getting the most out of Rapid Accelerator mode. Using R2015a, I opened up the "sldemo_bounce"-model, enabled the Inline parameters option under Configuration parameters --> Optimization --> Signals and Parameters and saved it under a new name ("bounce_demo"). The code I am trying to run looks like this:
clearvars; clc;
k = Simulink.Parameter;
k.CoderInfo.StorageClass = 'SimulinkGlobal';
k.Value = -0.9;
mdl = 'bounce_demo'; % Renamed version of "sldemo_bounce" with Inline Paremeters enabled, nothing else changed
open_system(mdl)
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget(mdl,'AddTunableParamInfo','on');
The model compiles without warnings/errors, but rtp.parameters.map is empty (= []). rtp.parameters.value has all the values of the bouncing ball model, but somehow the corresponding mapping field does not hold the variable names. So when I try to change the variable "k" according to the above mentioned example by
k_values = [-0.9:0.1:-0.1];
for i = 1:length(k_values)
paramSet(i) = Simulink.BlockDiagram.modifyTunableParameters(rtp, 'k', k_values(i));
end
it does not work as "k" is not defined within the rtp-structure (Error using modifyRTP The rtp structure passed in did not have a parameter k).
So is there any setting I am unaware of or the author has forgotten to mention in the above article to make it work?
Also I am unsure at what point the actual executable (.exe) is created as so far none has been created. Only the "slprj"-folder is created.
Any feedback is highly appreciated.
  댓글 수: 1
Tong Zhao
Tong Zhao 2022년 2월 16일
I experienced similar error:
Error using modifyRTP
The rtp structure passed in did not have a parameter ACC_ADJ
Have you figured out the solution? Thanks.

댓글을 달려면 로그인하십시오.

답변 (1개)

Tong Zhao
Tong Zhao 2022년 2월 16일
I had a similar problem, and here's how I resolved it:
In my Simulink model, the tunable parameters I provided did not contribute to the output of the model, and that was why the error popped out:
Error using modifyRTP
The rtp structure passed in did not have a parameter ACC_ADJ
Then I corrected the mistake, and made sure that the tunable parameter I have will affect the output of the model. Then everything worked fine.
Hope this helps.

카테고리

Help CenterFile Exchange에서 Accelerated Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by