Effacer les filtres
Effacer les filtres

ODE15 problem in java web deployment

2 vues (au cours des 30 derniers jours)
Zetty  Zakaria
Zetty Zakaria le 6 Juil 2014
Commenté : Zetty Zakaria le 7 Juil 2014
I am producing a java web with a library compiled from Matlab Builder JA containing ODE15s. I have no problem running it in MATLAB. But when I try to run the project on server, there is an error as follows:
com.mathworks.toolbox.javabuilder.MWException: PK_MODEL_V1 returns a vector of length 4, but the length of initial conditions vector is 7. The vector returned by PK_MODEL_V1 and the initial conditions vector must have the same number of elements.
Can someone please help on how to solve this? Here is the files containing my project should you need to refer the problems of my project in detail. Really appreciate your help. Thanks.

Réponse acceptée

Titus Edelhofer
Titus Edelhofer le 6 Juil 2014
Hi Zetty,
a trick that often helps debugging such issues is to save the input data of your deployed function into a .mat file, run the deployed component, load the .mat and debug in MATLAB. Something like
function mylibrary(someInput, anotherInput)
if isdeployed
save c:\temp\inputdata.mat
end
When you run you component, debug:
debug stop if error
load c:\temp\inputdata.mat
mylibrary(someInput, anotherInput);
You might see that the input data are not exactly as you expected them to be.
Titus
  3 commentaires
Titus Edelhofer
Titus Edelhofer le 7 Juil 2014
Hi Zetty,
when you compile your code with the Builder JA, you specify the function that becomes the method in your java class. Copy the lines 2-4 from above (the "if") at the beginning of your existing .m file. The second code you execute in MATLAB after running the java code (replacing the call to "mylibrary" and the input variables by your existing code (with it's own variables).
Hope this helps,
Titus
Zetty  Zakaria
Zetty Zakaria le 7 Juil 2014
Solved it! Thanks!

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 6 Juil 2014
Could it be a permission thing, like you tried to write something out the server and it didn't let you. Do you write anything out to a file? If so, where?
  1 commentaire
Zetty  Zakaria
Zetty Zakaria le 6 Juil 2014
Modifié(e) : Zetty Zakaria le 6 Juil 2014
Hi Image Analyst. I don't write anything out the server. I just make a simple html web page, with 2 variables. Time (integer) and Dose (string array for the ode function). These inputs will then be used to form a graph using matlab library, which will be displayed under jsp file. I attach all the related files Here should you need more details. Thanks in advance!

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by