フィルターのクリア

startup.m for Matlab in Docker does not execute some commands

2 ビュー (過去 30 日間)
Nasser Hosseini
Nasser Hosseini 2024 年 3 月 13 日
編集済み: Nasser Hosseini 2024 年 3 月 25 日
Hi!
startup.m for Matlab in Docker does not execute some commands, for instance a simple disp() in the example below:
function startup
% Setup default proxy settings based on the environment variables that
% we will have set in the run.sh script
host = getenv('MW_PROXY_HOST');
port = getenv('MW_PROXY_PORT');
if ~isempty(host) && ~isempty(port)
% Replace the deprecated JAVA API with a wrapper
matlab.net.internal.copyProxySettingsFromEnvironment();
end
addpath('/tmp/windows-file-share/MATLAB/BFR2LocMEdrive'); %OK
cd ('/tmp/windows-file-share/MATLAB/BFR2LocMEdrive'); %OK
disp('Welcome!') % !!!! NOT EXECUTED !!!
end
Does anybody know the reason for this behaviour and if it can be fixed?

採用された回答

Karanjot
Karanjot 2024 年 3 月 23 日
Hi Nasser,
Debugging commands are not designed to work when MATLAB is started as an automation server. This is because most applications that use the Automation server run without user interaction and would not benefit from having messages displayed to the command window.
The debugging functions that will not work in Automation mode include:
FPRINTF
SSCANF
DISP
A workaround is to use the MSGBOX command to display a status message in a pop-up message box. It is possible to modify the string displayed in a message box instead of creating new message boxes for each status message. For example:
m = msgbox('Original Message')
t= findobj(m,'type','text')
set(t,'String',{'Modified Message'})
Another option is to store the output of a debugging command such as DISP into a string by using the EVALC function. This string can then be pulled into the client application and displayed for debugging purposes.
  1 件のコメント
Nasser Hosseini
Nasser Hosseini 2024 年 3 月 25 日
編集済み: Nasser Hosseini 2024 年 3 月 25 日
Thank you very much for your detaild answer! msgbox works fine!
Have a nice day!
/Nasser

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContainers についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by