1

I have 'inherited' Matlab code (A) that uses another compiled Matlab code (B). I do not have the source of B. B requires user intervention ('Hit return to continue'), and I need to use A in a loop. I need to do something so I would not need to hit Return each and every time until the loop is done.

The command I use in the loop is:

str='!start "Code_B" /low "c:\Code_B\bin\Code.exe" r';
eval(str)

Are there any other switches that I can use to suppress the call to 'Hit return' ?

Thanks

Katto

Paul R
  • 208,748
  • 37
  • 389
  • 560
katto
  • 11
  • 1

2 Answers2

0

One way you could do this is to create a batch file that:

  1. Starts the compiled Matlab program
  2. Waits for the program to run (fixed delay?)
  3. Uses a utility to send the program an Enter key

There are many (free) utilities that let you send keystrokes to a program.

Instead of calling Program B, you would call this batch file.

grantnz
  • 7,322
  • 1
  • 31
  • 38
0

You can create a text file, let's say autoreturn.txt, with many empty lines (just end of line characters), over the number of loops you expect. Then add redirection of input from this at the end of your string:

str='!start "Code_B" /low "c:\Code_B\bin\Code.exe" r < autoreturn.txt';
yuk
  • 19,098
  • 13
  • 68
  • 99