Hi,
I want to start Matlab, then run an m-file automatically.
Below is what I've done so farin VB.NET.
__________________________________________________________________________
Shell("C:\MATLAB6p5\bin\win32\matlab.exe", AppWinStyle.MaximizedFocus)
Thread.Sleep(20000)
SendKeys.SendWait("m-file")
SendKeys.SendWait("{ENTER}")
__________________________________________________________________________
I had to use 'sleep' to wait for Matlab to load completely before sending keys, otherwise nothing will happen.
The question is: is there a command instead of 'sleep' that knows when the application has loaded and is ready to receive keystrokes?
Also, I want matlab to quit automatically after the m-file has been run. How can I do that?
Thanks in advance for your help.