Eliminating the warnings while creating standalone application in MATLAB App Designer

Hi,
I am new to MATLAB App Designer. I tried to create a standalone appilcation. After packaging, in the log file, the following warnings came out:
Warning: In "C:\Users\furka\Documents\MATLAB\BazantD.m", "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.
Warning: In "C:\Users\furka\Documents\MATLAB\BazantG.m", "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.
Warning: In "C:\Users\furka\Documents\MATLAB\Version45.mlapp", "int, 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 "C:\Users\furka\Documents\MATLAB\Version45.mlapp"
(referenced from command line).
Due to elimination of these, my app is not working very well. How can I eliminate those warnings in order to function my app?
ps: I am using R2020a version.

 Accepted Answer

Nothing in the Symbolic Toolbox can be compiled into an exe or application, and it also cannot have code generated using MATLAB Coder .
Your use of int() tells us that you are trying to generate new equations inside the compiled application. You cannot do that.
The work-around is to split the program into two pieces.
One piece will be run interactively, and will generate the equations. Then in that interactive version, use matlabFunction() with 'File' option to write to a .m file. The generated .m will be purely numeric -- including having transformed int() into integral() if necessary.
The second piece is the one that will be compiled. It will refer to the .m that you wrote into, which has the pure numeric function, and so will be able to compile it.
If you wanted to change the equation, you would have to go back to the interactive version and generate a new .m file.

9 Comments

Thank you for your answer Roberson. I am using the syms and int inside of a function. Using symbolic expressions, I obtain the results. My code is simply as:
function [a1,b1,c1,d1] = Taca12(type,xcm1,xce1,hf,ht,bf,tw,tH1,tD1,sD,thco,Icompm1,Icompe1,nD1,t,ts,tf)
ti = find(ts==t,1);
te = find(tf==t,1);
length = te-ti;
for i=0:length-1
syms y
T1pmc1 = ((11/12)*(y-(xcm1(ti+i)-16)))*y;
Bmc1 = tw+(y-(xcm1(ti+i)-hf-ht-tH1-tD1))*(bf-tw)/ht;
if strcmp(type,'Rectangular')
bpm = int((thco*T1pmc1*nD1(ti+i)*sD*y), (xcm1(ti+i)-tD1), (xcm1(ti+i)-4));
end
end
end
Creation of symbolic expression is also based on the input. How can I write this code without using syms and int functions.
Any help is appreciated.
That code can be replaced by
function [a1,b1,c1,d1] = Taca12(type,xcm1,xce1,hf,ht,bf,tw,tH1,tD1,sD,thco,Icompm1,Icompe1,nD1,t,ts,tf)
error('Failed to assign to any of the output variables')
end
You can use the formula to pre-compute
XCM1 = xcm1(ti:ti+length);
ND1 = nd1(ti:ti+length);
bmp = (11.*ND1.*sD.*thco.*(tD1 - 4).*(208.*tD1 - 640.*XCM1 - 160.*tD1.*XCM1 - 6.*tD1.*XCM1.^2 + 8.*tD1.^2.*XCM1 + 52.*tD1.^2 - 3.*tD1.^3 + 168.*XCM1.^2 + 832))./144;
which is the vectorized calculation without the loop, and already integrated.
Thank you so much for your help! It works well.
Walter Robertson, thanks for the response. Could you give an example?
compile a standalone app that receives a string from the user in an EditField (Text), converts it into a function and displays its indefinite integral in an EditField (Text)
No, you cannot do that.
Even if you managed to convert the string to a function, you would run into the problem that indefinite integration is part of the Symbolic Toolbox, and nothing in the Symbolic Toolbox can be compiled.
The closest you would be able to get would be to have an interactive program that accepted equations and found their indefinite integral and saved the equations and the indefinite integrals to files. Then the compiled application would read the files of saved equations and saved indefinite integrals, give a menu of saved equations, and pull out the corresponding pre-saved indefinite integrals.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!