是否可以从 Matlab 向 OSX 中的通知中心发送通知?

Saa*_*kke 5 macos matlab notifications

我想在我的 Matlab 代码运行完毕后向通知中心发送通知。我在 Mountain Lion 10.8.3 上使用 Matlab 2012b。这可能吗?如果是这样,如何?

Mat*_*tyB 4

这是一个完整的功能。它显示 Matlab 作为名称和图标,单击通知将带您进入 Matlab:

function notify(message)
  escaped_message = strrep(message, '"', '\"');
  [~, ~] = system(['/usr/local/bin/terminal-notifier ' ...
                   '-title Matlab ' ...
                   '-group com.mathworks.matlab ' ...
                   '-activate com.mathworks.matlab ' ...
                   '-sender com.mathworks.matlab ' ...
                   '-message "' escaped_message '"']);
end
Run Code Online (Sandbox Code Playgroud)