Runtime error in compiled standalone

Hi
I wrote a code whitch gets some input and compute some parameters at the end
Now I want to get an exe file of it so everyone can use it
I am doing it using deploytool, the problem is, when i run the final app, a black window comes and sunddenly disappears with an error that there is an unrecognized function named "syms" while the source runs fine within matlab.
How can i use deploypool without getting errors for functions in my code?
and also, i get the parameters at the end just by not putting semicoloums. it seems that it is not possible in exe mode.
is there anything that i should add to my code to have the output?
thanks

 采纳的回答

Steven Lord
Steven Lord 2020-10-16
"Creation of symbolic expressions, such as using sym, syms, and str2sym" in a standalone application created with MATLAB Compiler is not supported.

5 个评论

So what should i do?
what can i use instead of syms in my source code?
That question is difficult to answer without knowing how you're using the capabilities of Symbolic Math Toolbox in your app. If you're trying to solve a system of equations maybe use functions from Optimization Toolbox or Global Optimization Toolbox to solve them numerically instead. You could perform your symbolic calculations in MATLAB (not your standalone application) and use matlabFunction or the like to convert those into a function that you can then use in your application.
Thanks a lot
here is a simple form of my equation:
syms S1 S2
S=solve(5*S1+2*S2==6,6*S1+5*S2==4,S1,S2);
So i searched a little bit and i found this instead:
Left=[5 2;6 5];
Right=[6;4];
S = linsolve(Left,Right)
but it gives an error on this again.
also i have a problem with windows command shell. when it comes to show the error ,the window suddenly dissappear although i unchecked "Do not display the windows command shell".
Should i add disp() or sth like that to my code?
thanks again
linear systems like that can be solved with the \ operator
Thank you very much
It worked
Just the last question
how can i make the black window not disappear suddenly after showing the results?

请先登录,再进行评论。

更多回答(0 个)

产品

版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by