I have a long-running Matlab script for data processing. I want to send it a flag over stdin to tell it I have new data to process. I also want to read a flag from stdout when it is done processing.
In other words, I have a Process A that sends a flag about once a minute to Matlab. I want Matlab to wait until it receives this flag.
Writing to stdout in a matlab process is as easy as calling fprintf. But how can I read from stdin? Documentation on fopen doesn't mention an input pipe, and neither does fread. How can get a Matlab script to read from stdin?
inputbuiltin would not work because I think it reads directly from the keyboard, not stdin.)