필터 지우기
필터 지우기

Delete application on target computer programmatically

조회 수: 1 (최근 30일)
Matteo Pellegri
Matteo Pellegri 2021년 11월 5일
댓글: Matteo Pellegri 2022년 12월 1일
Hello, I am trying to delete an application on my target machine (SpeedGoat) programmatically.
I am essentially trying to replicate what the Delete button of the Simulink Real-Time Explorer does.
Which function (or hidden function) does this?
Thanks in advance!

채택된 답변

Dimitri MANKOV
Dimitri MANKOV 2022년 12월 1일
Hi Matteo,
The function "removeApplication" was introduced for that purpose in MATLAB R2022a. Furthermore, the function "removeAllApplications" is available since R2022b.
I hope this is helpful!
Dimitri
  댓글 수: 1
Matteo Pellegri
Matteo Pellegri 2022년 12월 1일
Hi Dimitri, thanks very much for the answer. It's very helpful.
I know about the new functionalities introduced already from 2021b and they seem to address many of the issues I am having with 2020b. Unfortunately with 2020b I had to use a workaround. It's not the same but it does the job, however old applications are not removed from the machine so I have to go there once in a while to do a clean-up.
Here's my code
tg = slrealtime('yourTarget');
tg.connect;
[file,path] = uigetfile({'*.mldatx'},...
'File Selector');
if file~=0
try
if isRunning(tg)
stop(tg);
end
install(tg,fullfile(path,file),'force') %<--- does the trick
load(tg,extractBefore(file,'.')); %<--- does the trick
setStartupApp(tg,extractBefore(file,'.')) %<--- does the trick
start(tg); %<--- does the trick
msg = ['Loaded ', file];
disp(msg);
catch
msg = ['Could not load ', file];
disp(msg);
end
end
Hope this helps as well. We will move to 2022b at some point.
Best,
Matteo

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by