Error in the function "Simulink.compiler.configureForDeployment" using App Designer
조회 수: 3 (최근 30일)
이전 댓글 표시
I was trying to do a matlab app and I started to get the error:
"Dot indexing into the result of a function call requires parentheses after the function name. The
supported syntax is 'simulink().compiler'."
On the line where I have the function "Simulink.compiler.configureForDeployment"
This is the code I use on the button callback:
Model_Name = ('Prueba');
simInp = Simulink.SimulationInput(Model_Name);
simInp = simInp.setVariable('irradiance', app.IrradianceEditField.Value);
simInp = simInp.setVariable('temperature', app.TemperatureEditField.Value);
simInp = simulink.compiler.configureForDeployment(simInp);
stopTimeStr = num2str(app.SimulationTimeEditField.Value);
simInp = simInp.setModelParameter('StopTime', stopTimeStr);
simInp = simInp.setModelParameter('SimulationMode', 'Rapid');
simOut = sim(simInp);
time = simOut.tout;
current = simOut.yout{1}.Values.Data;
power = simOut.yout{2}.Values.Data;
voltage = simOut.yout{3}.Values.Data;
plot(app.UIAxes, time, current);
plot(app.UIAxes2, time, power);
plot(app.UIAxes3, time, voltage);
plot(app.UIAxes, voltage, power);
Thank you!
댓글 수: 1
Alvaro
2023년 1월 27일
Do you get the same error with the example on the documentation? Try this with a copy of sldemo_suspn_3dof in the same directory as your model 'Prueba'.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!