Delete application on target computer programmatically

3 Ansichten (letzte 30 Tage)
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!

Akzeptierte Antwort

Dimitri MANKOV
Dimitri MANKOV am 1 Dez. 2022
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 Kommentar
Matteo Pellegri
Matteo Pellegri am 1 Dez. 2022
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by