how to send data saved in "out1" block to display it to the GUI label element
조회 수: 1 (최근 30일)
이전 댓글 표시
hello i am trying to send data saved in the out 1 block to a GUI label element to display it. i am getting an error when i am using this:
properties (Access = public)
Property % Description
Set=0;
temp=0;
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
clc;
clear all;
close all;
instrreset;
sim('PID_control_of_the_SOPDT_PID_testing2');
%%%
app.temp = get_param('PID_control_of_the_SOPDT_PID_testing2/Out1','RuntimeObject');
app.Label_2.Text=num2str(app.temp);
end
the error that i am getting is
Invalid or deleted object.
Error in Project_GUI (line 364)
runStartupFcn(app, @startupFcn)
댓글 수: 0
답변 (1개)
Image Analyst
2022년 1월 1일
Yes, because you deleted them when you called clear and/or close. Get rid of these lines:
clear all;
close all;
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!