Delete application on target computer programmatically

8 ビュー (過去 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 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by