How to use an external script/app to automatically start the matlab model without the user having to manually press the run button
    6 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
Hi I'm hoping someone can help me..
I have created a complex model that incorporates many scripts and functions, and all of these are ran from a main script file.
I was wondering if it is possible to use an outside script or different application to start the main script file. My idea is to have a StartModel app that will run the matlab code automatically which would mean that the user would not have to open the script and manually press the run button.
Thank you, any help will be much appreciated.
Tadgh
0 Kommentare
Antworten (2)
  Mischa Kim
    
      
 am 13 Jan. 2014
        
      Bearbeitet: Mischa Kim
    
      
 am 13 Jan. 2014
  
      You can use callbacks in your GUI for this task. See for example http://www.mathworks.de/de/help/matlab/creating_guis/initializing-a-guide-gui.html.
3 Kommentare
  Mischa Kim
    
      
 am 15 Jan. 2014
				I believe, that's exactly what you need: they are called Apps. See a short video on how to develop an App here.
In your case the App could be pretty simple, since you are only (at this point) would use it to run your main script, which, in turn, would call all the other scripts.
  Walter Roberson
      
      
 am 15 Jan. 2014
        Use the command line flags when MATLAB is invoked. For example create a .bat file that has
matlab.exe -r "try cd('C:\Appropriate\Directory'); NameOfScriptToStart; catch ME; end; quit"
Then the user would double-click the .bat file in order to launch NameOfScriptToStart .
Note: do not include the ".m" suffix in NameOfScriptToStart .
Siehe auch
Kategorien
				Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
			
	Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!