matlab standalone desktop app stuck in syms command
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Wong Slocked
le 24 Août 2021
Modifié(e) : Wong Slocked
le 25 Août 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.
0 commentaires
Réponse acceptée
Steven Lord
le 24 Août 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 commentaires
Steven Lord
le 24 Août 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!