Matlab - 命令完成后的信号

SPR*_*pal 3 windows matlab

当命令完成时,有没有办法设置matlab来到窗口的前台?我可以通过执行dos()看到它发生但我不知道窗口管理是如何工作的?也许有更好的方法?有人?

Joh*_*ohn 7

两种选择.也不是你要求的.

选项1:打开一个新数字.

   figure();
   imagesc(processingDoneSplashImage);
Run Code Online (Sandbox Code Playgroud)

如果你想得到花哨,把它放在一个脚本,带有计时器,并在亮绿色和亮红色之间闪现图像....

选项2:我的问题解决方案.(我发现弹出窗户非常烦人.)我在长时间运行的脚本结束时调用了这个函数,计算机告诉我它何时完成处理....

function [ ] = matSpeak( textToSpeak )
%matSpeak takes some text, and outputs onto the speaker the text,
% using the .Net SpeechSynthesizer.
%  This only works on Windoze. 

if ~exist('textToSpeak','var')
    textToSpeak = 'Your processing has completed.';
end

NET.addAssembly('System.Speech');
speak = System.Speech.Synthesis.SpeechSynthesizer;
speak.Volume = 100;
speak.Speak(textToSpeak);

end
Run Code Online (Sandbox Code Playgroud)