matlab standalone desktop app stuck in syms command

2 ビュー (過去 30 日間)
Wong Slocked
Wong Slocked 2021 年 8 月 24 日
編集済み: Wong Slocked 2021 年 8 月 25 日
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.

採用された回答

Steven Lord
Steven Lord 2021 年 8 月 24 日
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 件のコメント
Steven Lord
Steven Lord 2021 年 8 月 24 日
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 2021 年 8 月 25 日
編集済み: Wong Slocked 2021 年 8 月 25 日
Thanks again.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by