matlab standalone desktop app stuck in syms command
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
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
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.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!