필터 지우기
필터 지우기

ODE15 problem in java web deployment

조회 수: 2 (최근 30일)
Zetty  Zakaria
Zetty Zakaria 2014년 7월 6일
댓글: Zetty Zakaria 2014년 7월 7일
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.

채택된 답변

Titus Edelhofer
Titus Edelhofer 2014년 7월 6일
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
Titus Edelhofer
Titus Edelhofer 2014년 7월 7일
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 2014년 7월 7일
Solved it! Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 7월 6일
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
Zetty  Zakaria
Zetty Zakaria 2014년 7월 6일
편집: Zetty Zakaria 2014년 7월 6일
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!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Java Client Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by