Filter löschen
Filter löschen

Calling fft from JAVA code does not work

1 Ansicht (letzte 30 Tage)
Frank Gomez
Frank Gomez am 30 Nov. 2011
Hello Everyone!
I have this piece of code in a matlab function (let's call it, matfun)
time_dip= double(senyal_V')
Pyy=fft(time_dip,n);
senyal_V is an array that I get as a parameter from a JAVA function, javafun, which I create as follows:
MatlabClass objecte= new MatlabClass();
double[] arreglo = {6.2d, 6.2d, 3.2d, 4.2d, 4.2d, 6.2d};
MWNumericArray mwarreglo = new MWNumericArray(x3, MWClassID.DOUBLE);
output = objecte.matfun(1,mwarreglo,4);
mwarreglo is the same parameter as senyal_V. The tricky thing is in the execution of the matfun in JAVA code. In the .m code you see a double cast, but still doesn't work. Either by defining the parameter senyal_V, as mwarreglo or arreglo type, it doesn't work. I don't know what to do to solve this problem. What drives me crazy is that if I invoke the matfun directly in Matlab, it works, no matter how I declare this parameter.
Any suggestions?
Thanks!

Antworten (0)

Kategorien

Mehr zu Java Package Integration finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by