Program running in m file, but not in exe after compiling using Matlab Compiler
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Walter Roberson
le 4 Fév 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'))
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur C Shared Library Integration dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!