Program running in m file, but not in exe after compiling using Matlab Compiler
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bakka
el 4 de Feb. de 2014
Comentada: Bakka
el 4 de Feb. de 2014
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 comentarios
Respuesta aceptada
Walter Roberson
el 4 de Feb. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre C Shared Library Integration en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!