フィルターのクリア

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 Center および File ExchangeJava Client Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by