View errors of Standalone-App created with Matlab Compiler

조회 수: 37 (최근 30일)
Dominik Müller
Dominik Müller 2020년 9월 16일
댓글: Sean Lee 2022년 3월 11일
Hi everyone,
I'm new to Matlab Compiler and the export of standalone apps.
I have a Matlab Script which get's some information of a PLC and plots this information to a figure (dynamic process). I implemented a little GUI to select some specific details of the PLC which changes the view on the figure . Everything works fine if I start the GUI from App Designer. But after the compilation with Matlab Compiler the figure doesn't open, just the GUI appears. There is a sound which seems to indicate an error but no error message is displayed.
I followed this answer and tried to get an error message:
But there's no message displayed. Is there any chance to create something like a log-file while running the compiled app or another way to display errors?
I'm using Matlab R2020a and all answers I found on this topic are frome some years ago.
  댓글 수: 1
Dominik Müller
Dominik Müller 2020년 9월 16일
I was able to solve the problem by creating message boxes
msgbox()
which showed me the current step on the program. There was an
addpath
which could obviously not be compiled. After removing this command, the program runs perfectly as standalone app.
It would still be nice to know how to display errors in a log-file, would be much easier than creating lots of messageboxes...

댓글을 달려면 로그인하십시오.

채택된 답변

Dominik Müller
Dominik Müller 2020년 11월 25일
While exporting your app with Compiler scroll down to the topic 'Additional runtime settings' and put a check on 'Create log file'.
  댓글 수: 1
Sean Lee
Sean Lee 2022년 3월 11일
I tried this setup (checked on 'Create log file') with a generic file name 'Logfile.txt' (since without it, it cannot be set.)
During a normal program execution in Matlab environment, a unique diary file name is assigned and being created OK using diary ON/OFF commands. But, if this is packaged as a stand-alone app and executed on a compouter of no Matlab license, both files of 'diary' file and the above 'Logfile.txt' are created with no contents -all empty.
Anybody knows other trick?
Also, is there any way ot make those scripts shown in Matlab command window be seen in DOS' cmd window for a packaged app?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Puru Kathuria
Puru Kathuria 2020년 11월 25일
Hi,
You can try using "diary" command to write errors to a log file.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by