how to store the result of a dos command into a file in matlab
Ältere Kommentare anzeigen
Hello, I would like to store the result of the dos command into a text file, which i want to read later in matlab. i used the following code
[status, Result] = dos(Iperf_command,'-echo');
fid=fopen('result.txt','w');
fprintf(fid,'%6.2f %12.8f\n',Result);
fclose(fid);
but t didnt work out. Please help me in this regard.Thanks in advance.
Akzeptierte Antwort
Weitere Antworten (1)
Dear Uday Teja, "Iperf_command" is not a valid "dos" command. You should use keyword "help" in dos command prompt to get the list of valid commands you can use in dos command prompt. For example, "ver" is a valid command then you can use "dos" command in MATLAB as:
[status, Result] = dos('ver','-echo');
Will give you version of Windows. The out result should be handled with correct formatting to write in a text file. Good luck!
Kategorien
Mehr zu Data Import and Export finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!