matlab standalone desktop app stuck in syms command

7 Ansichten (letzte 30 Tage)
Wong Slocked
Wong Slocked am 24 Aug. 2021
Bearbeitet: Wong Slocked am 25 Aug. 2021
Hi there, I encountered a problem developing a matlab app.
When I debug in the matlab app designer, no problem occurred, so I generated the standalone desktop app.
However when I run the deployed the standalone desktop app, it appears that it got stuck somewhere, not being able to display the right results.
Since a standalone app is quite hard to debug, I have to write a log file for the app and the self-written class invoked, to check which line the app had stopped. (BTW is there a more efficient way to debug in a situation like this?)
I found the app stopped in the self-written class invoked. The context code is as follows.
fid = fopen('D:\Matlab App License\create_polylog.txt','w+');
fprintf(fid,"0\r\n");
n = obj.order;
obj.coef_table=string(zeros(n+1,4));
obj.index = [];
fprintf(fid,"1\r\n");
syms 'p%d' [1,n]
syms x y p0
poly = p0;
fprintf(fid,"2\r\n");
where the log file result is,
0
1
It seems the app stops trying to create a syms object? Is there anything I can do to debug this?
Thanks a lot.

Akzeptierte Antwort

Steven Lord
Steven Lord am 24 Aug. 2021
Creation of symbolic expressions using sym or syms is not supported in MATLAB Compiler as stated on this documentation page. Perform the symbolic calculations and generate a MATLAB function file using matlabFunction in MATLAB then include the generated function file in your deployed app.
  3 Kommentare
Steven Lord
Steven Lord am 24 Aug. 2021
Use isdeployed to determine if the code is running as a deployed application or not. If it is you cannot use sym or syms and will need to run an alternate code. One way to create that alternate code as a separate function file is using matlabFunction ahead of time.
Wong Slocked
Wong Slocked am 25 Aug. 2021
Bearbeitet: Wong Slocked am 25 Aug. 2021
Thanks again.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by