I met 'Function call Failed' error while I convert .m files to C with MATLAB coder.
11 views (last 30 days)
I'm trying to convert my .m files to C code with MATLAB coder. Many things should have been changed.
Anyway, look at following three lines. They are in a function that I made. They call 'rand' function.
PF_state_init(1,:) = 20*rand(1,N_particle);
PF_state_init(2,:) = 20*rand(1,N_particle);
PF_state_init(3,:) = 2*pi*rand(1,N_particle);
PF_state_init is defined as a global variable in the main script .m file.
There it is initialized. (PF_state_init = zeros(3,350);)
It is also defined as a global variables in the function.
I only call the script .m file when I execute the whole codes.
The problem is... when I tried to convert them to C code, MATLAB coder showed
'Function call failed'
I tried many things but I failed. N_particle is defined as a global variable and
it is also initialized (N_particle = 100;)
What on earth is the problem?