How to get MATLAB to process the files specified in batch
조회 수: 4 (최근 30일)
이전 댓글 표시
How to get MATLAB to work with the files specified in batch. I have converted the program edited in matlab to .exe. I hope that batch will enable .exe to batch process any file I specify in batch. That is, I just need to change the name of the folder in batch, and .exe can batch process it.
댓글 수: 0
답변 (2개)
Walter Roberson
2022년 5월 17일
You can have the code call uigetdir() if you want to prompt the user for the directory name.
Or you can make the main function into one that accepts one or more argument, and then if someone used the executable name and then the directory name on the Windows command line, then the function would receive the directory name as a parameter.
Caution: it is not uncommon in Windows for directory names to have spaces in them, but it the user were to command, for example
PlotOde.exe C:\Users\Sam\Assignment 7\Odes
then the part before the 7 would be one parameter, and the 7 on would be a second parameter. Windows would consider the space as the end of the parameter unless you make sure to use double-quotes to tell Windows to treat it as a single parameter.
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!