命令行不会等到exe执行完成

use*_*647 6 matlab cmd exe matlab-compiler

我将我的matlab程序转换为独立的exe程序.当我从命令行调用exe时,它不会等到执行exe.该程序运行大约需要20-30秒.该程序基本上创建了一个txt文件.如何让它等到exe执行.我的matlab主要功能是

function []=features(img_path,category,output_path)
if (strcmp('shoe',category)== 1)
    if exist(img_path,'file')
     test_shoes(img_path,output_path);            
    else
        disp ('Input image path does not exist');
    end     
else
    disp('Sorry wrong input for category.Please give shoe/dress/handbag');

end
return;
Run Code Online (Sandbox Code Playgroud)

问题显示在下面的屏幕截图中:

"所有警告都有'关闭'状态." 实际上是由MATLAB的exe在5秒后显示,但终端不会等到exe完成执行,即"E:\ test>"在调用exe后立即显示在下一行.

如何使命令行等到exe os完成执行,以便新命令行在完成之前不会出现?

Luc*_*II. 22

您可以尝试像这样运行它:

启动/等待MyProgramm.exe

看看这里:

怎么办,你等待换一个-EXE到完整功能于批处理文件

  • 你可以使用批处理文件! (2认同)