How can I code for something which is running?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ali
am 15 Dez. 2014
Beantwortet: Image Analyst
am 15 Dez. 2014
I want to programme in such a way that if some script file is run then that function should be called. LIke I coded if run(file.m)=1 do something end But this does not work
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 15 Dez. 2014
You can have some listener monitoring some variable in the base workspace that indicates when your script have finished and then do something. Like let's say the script will create a variable that's called "scriptIsDone". Then you can just use evalin() to check it
scriptIsDone = evalin('base', 'scriptIsDone');
if scriptIsDone
% Do something.
end
Put it in a loop or use a timer or something so you repeatedly check it.
0 Kommentare
Weitere Antworten (1)
Julia
am 15 Dez. 2014
Hi,
How about this:
You can use strcmp() to check if the last file run was your file.m
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!