how to automatically feed the current or most recent data file saved in a directory (.ask) to Matlab executable

1 view (last 30 days)
Hi All,
I have a case in which call a Matlab Gui executable from the Labview executable, Labview save the files in .ask format in a particular format, what I wanted to do is feed those recent data files directly to the Matlab Gui automatically without choosing .Is there a way to do it. Please let me know.
thanks,
Ankit Gupta

Answers (1)

Walter Roberson
Walter Roberson on 6 Jun 2012
On each of the operating systems that MATLAB currently runs on, there are mechanisms that can detect when a new file is created. Unfortunately, there are no mechanisms to detect when the new file is "ready" for another program to use, no method to detect that the creating process has finished writing to the file and is no longer interested in it.
You can use dir() and sort based on time, but this has the same limitation: the fact the file exists does not mean it is ready for reading.
Some applications are considerate of this issue, and write the file under another name and then rename it to the desired name when they are ready to release it. I don't know if LabView does that (and suspect that it does not.)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!