save the output of system command using matlab
Show older comments
Hello! I am executing a system command via matlab. in the command I am writing the output to a file. when running the code I can find the generated file but I want that file be passed to Matlab as a variable, how can I get to this ? see the code bellow (I want something so that fileA.txt be attributed to cmdout or any thing similar so Matlab can recognize and work directly with the file)
command = 'MyInstuction >fileA.txt';
[status,cmdout] = system(command);
Accepted Answer
More Answers (2)
Walter Roberson
on 28 Nov 2016
Leave off the redirection. Just
command = 'MyInstuction';
[status,cmdout] = system(command);
Ano
on 29 Nov 2016
0 votes
3 Comments
Jan
on 29 Nov 2016
Please post comments in the comment section, not as an answer. Thanks.
How can the generated file be large, if you omit the generation of a file? How could we know, where you can find the wanted parts of the replied string?
Ano
on 29 Nov 2016
Jan
on 29 Nov 2016
If the repsonse is time critical, please answer my questions for clarifications. I'd really like to assist you, but I cannot guess, "how can I know where my data is placed".
Categories
Find more on Get Started with MATLAB 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!