Program running in m file, but not in exe after compiling using Matlab Compiler
1 view (last 30 days)
Show older comments
Hi everyone, I have build a program that run properly in m file MATLAB. but when I compile to exe using Matlab compiler, some function didn't work. here is the error command window show on matlab execute program
undefined function or method 'maple' for input arguments of type 'char'
error in ==> function_a at 5
codes on function_a.m is
function function_a(msg)
format long
%parameter p & q
maple('z1:=',randint(1,1,[12 20])); %these run in m.file, but not in exe compile
p=maple('nextprime(z1)');
p=str2double(p);
is there any solution for that?please need your advice, many thanks
0 Comments
Accepted Answer
Walter Roberson
on 4 Feb 2014
The Symbolic Toolbox functions cannot be compiled, and that applies whether you used the older Maple based toolbox or the newer MuPAD based toolbox.
If you are not using Symbolic Toolbox, but have installed a full Maple and allowed it to add in symbolic hooks in MATLAB, then still it cannot be compiled.
randint() can be replaced by using MATLAB's randi([12 20]) or (older MATLAB)
(12 + floor((20-12+1) * rand))
nexprime is a bit more tricky to replace, but you could use
p = primes(23); %first prime after your maximum value
p(find(p >= z1, 1, 'first'))
More Answers (0)
See Also
Categories
Find more on Application Deployment in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!