MATLAB: Include fft.m in Java Project

fftjavamatlab builder ja

Hello everyone!
I have a matlab function (let's call it mfun) which calls the fft. I use this mfun in Java code, through a class created by Matlab builder JA (R2010a), but I get a java error "Undefined function or method 'fft' for input arguments of type 'int32'". I guess that Java cannot access to the fft function, the .jar file only has one class with this mfun. So, how can I include fft in the .jar?
Thanks!

Best Answer

Hi Frank,
The issue is not with deploying fft using Builder JA, but rather with fft itself. The fft function does not support integer classes as input arguments.
Please try the following at the MATLAB Command Line:
x = int32(randi([-256 255],128,1));
X = fft(x);
Notice that you get the same error message.
You can, however, coerce the integer class input argument to double or single to perform the transformation:
X = fft(double(x));
OR
X = fft(single(x));
HTH.
Rick