Sending DOS command to execute Matlab Function and getting the output back to DOS
3 views (last 30 days)
Show older comments
Michel on 30 Sep 2014
Commented: Alberto on 3 Oct 2014
I need to have a command be sent via DOS to execute a script/function. I'm already able to do this and it opens Matlab and shows the result of the function through the Matlab Command Window. I was wondering if there was a way to display the output in DOS command prompt?
thank you and I'd greatly appreciate the help.
Alberto on 1 Oct 2014
You have the command 'dos' so u can interpret some DOS command line, and catch the result of it. I extracted a few lines in the help of Matlab:
status = dos('command')
[status,result] = dos('command')
[status,result] = dos('command','-echo')
As an example:
[s, w] = dos('dir');
Is is what you needed? Good Luck
Alberto on 3 Oct 2014
With the instruction dos('dir') you can extract all files you have. Later, you can select which of them to use according to your own criteria. The selection can be done using regular expressions.
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!