getting string from the command window output
52 views (last 30 days)
Im a bit curious about this. I have a c++ .exe file that I call in matlab using system('command')and pass an input file (input.txt) to it and the result prints out in the command window. Now, I am wondering is there a way to actually scan that results and change it to double or number so I can plot it since nothing was really declared in matlab the results are not saved in the workspace. but I still would like to plot it. Can you help please?
Also any vague idea on how to get a min and max of an elapsed time using tic toc?
Jason Ross on 27 Feb 2013
Use system() like this
[status,result] = system('your_command.exe');
the output will be in "result" -- you may need to perform some function like str2double on the output that you get back -- check the variable type on "result".
to get min and max of an elapsed time, you could store the results of your runs in a vector and use min and max on it.
Jason Ross on 4 Mar 2013
Edited: Jason Ross on 4 Mar 2013
Have you tried using the Import Wizard on the file? Right click, "Import Data", then do what you need to, then under "Import Selection", you can generate a script or function. If you read the code, the import command will be in there (or you can just use the generated code ...)
Barring that, you'd need to post relevant data as without seeing it, it's a guessing game.