Why does MATLAB 7.0 (R14) pass my data as NULL to a Java method?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 27 Juin 2009
Modifié(e) : MathWorks Support Team
le 16 Avr 2023
I am using the MATLAB Java interface to pass data from MATLAB into a Java method I am calling. For example, I might try the following code:
data = rand(1,5000000);
myobject = MyClass;
myobject.myMethod(data)
However, for some data arrays, the call fails and MATLAB returns the following error:
ERROR: ??? Java exception occurred:
java.lang.NullPointerException
at MyClass.myMethod(MyClass.java:13)
Réponse acceptée
MathWorks Support Team
le 20 Fév 2023
Modifié(e) : MathWorks Support Team
le 16 Avr 2023
This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
This error message occurs when there is not enough memory to convert the MATLAB data array into a Java data array and pass it to the Java method. To work around this issue, try increasing the heap space for the Java Virtual Machine by following the steps in the following document:
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Call Java from MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!