MATLAB Answers

Problem with Matlab Standalone Application

38 views (last 30 days)
Junior Aguilar
Junior Aguilar on 28 Sep 2020 at 16:25
Edited: Junior Aguilar on 29 Sep 2020 at 1:13
Good morning to everyone.
I have developed an application in Matlab appdesigner but unfortunately at the time of exporting it as a desktop application, it doesn't work properly and I think it's because it's not exporting certain functions ("cell2sym, solve, str2sym, subs, syms") that I use in my code. How could I fix it? Make use of those functions frequently in my code. Thank you !
mcc -o ShaftDesign -W 'WinMain:ShaftDesign,version=1.0' -T link:exe -d D:\Programs\Matlab\AppDesigner\Tesina3_1\for_testing -v D:\Programs\Matlab\AppDesigner\Tesina2.mlapp -r 'C:\Program Files\Polyspace\R2020a\toolbox\compiler\resources\default_icon.ico'
Compiler version: 8.0 (R2020a)
Dependency analysis by REQUIREMENTS.
Warning: In "D:\Programs\Matlab\AppDesigner\Tesina2.mlapp", "cell2sym, solve, str2sym, subs, syms" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
Parsing file "D:\Programs\Matlab\AppDesigner\Tesina2.mlapp"
(referenced from command line).
Generating file "D:\Programs\Matlab\AppDesigner\Tesina3_1\for_testing\readme.txt".
Creating the bundle...
Creating the install agent URL file...
Web based installer created at D:\Programs\Matlab\AppDesigner\Tesina3_1\for_redistribution\MyAppInstaller_web.exe.
Packaging complete.
Elapsed packaging time was: 46 seconds.


Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 28 Sep 2020 at 17:14
Symbolic Toolbox can never be compiled.


Show 3 older comments
Junior Aguilar
Junior Aguilar on 28 Sep 2020 at 21:55
Hi Walter !
I have read the answer you gave to a user who had the same problem, and like his comment, I find your explanation of a possible solution to this problem a bit complex. But what I think I could understand, is that if the system of equations can be defined manually by the user and it is also static, it is possible to correct the problem through the division of the calculation process. However, I believe that the system of equations, in my case, is dynamic since it grows according to the parameters entered by the user and it would be very counterproductive for the user to define them manually since it is difficult and would take a lot of time. This makes my program different from other programs that are very limited, as they only include a few cases of calculation. I was looking forward to sharing my program with my colleagues because it is very didactic. I guess I will have to wait until Matlab can join RunCompiler with Symbolic Toolbox. Thank you very much for your answer and your time!
Walter Roberson
Walter Roberson on 29 Sep 2020 at 0:22
Suppose you had a situation in which you had a fixed list of design elements that the user could use. Say, for example, plus(), minus(), times(), divide(), sqrt(), power(), sin(), cos() . You could then create a user interface that permitted the user to put together trees of those -- you could even do some string parsing to analyze a user input phrase that was limited to operations you had determined in advance. You could use these elements and build a data structure that held a chain of function handles and operand references. And you could build a function that evaluated that data structure chain down to a numeric value.
Given those elements... you could fsolve() a wide range of user-configured formulas, without needing to use the symbolic toolbox.
You would not be able to use this approach if the desired output was a symbolic solution. The approach would also be weak on finding "all" solutions. The approach would not user-entered differential equations (technically you can pass a differential equation to solve() instead of dsolve()). Also, every permitted call would have to be configured in advance.
If you needed the full power of mathematic operations available through the symbolic toolbox without having to configure them all in advance -- if you want the user to be able to enter any arbitrary valid symbolic expression that interactive MATLAB could handle, if you want to be able to use the full power of calculus -- then you would not be able to use this approach.
Junior Aguilar
Junior Aguilar on 29 Sep 2020 at 1:10
Hello again!
Maybe you can tell me if there is a possibility that I can apply the solution you propose, in my app.
As you can see, this is the interface of my program, and it only admits numerical values by the user, from which, by means of my algorithm, a series of equations are generated.
These equations (generally a lot of equations) need to be integrated twice, so I generate two constants (for each equation, which I add them with "SYM", since the "INT" function does not generate them automatically) that I have to calculate, through of a large equations' system(here I use "SOLVE"). Once the values of these constants are calculated, they need to be replaced in their original functions, because then I will have to plot them with "FPLOT" through cycles, because as I mentioned before, my program is dynamic and adapts to all possible calculation cases that the user can define and want to solve.
All this process, which is a summary in fact, is necessary for the calculation of main efforts on power transmission shafts, which is the objective of my program and is a very important issue in the design of machine elements. The manual calculation is very tedious and extensive, so sometimes I use approximations that facilitate the calculation but add errors in the results, that's why I have been working a lot on this project. Thanks for responding!

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!