Delete application on target computer programmatically

3 次查看(过去 30 天)
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