Calling fft from JAVA code does not work
1 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Java Package Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!