Matlab figure to jar file
1 回表示 (過去 30 日間)
古いコメントを表示
Hi
I want to save a matlab file to a java file such that i can have zooming, rotate options after saving the plot. I know that deploy tool is used for this. When i tried to run the mfile before building it using deploytool I am getting the following error message:
Undefined variable "MWMCR" or class "MWMCR.getCurrent".
Error in ==> javawebfigure at 6 runtime = MWMCR.getCurrent();
Error in ==> webfigure at 50 f = javawebfigure(hnd);
Error in ==> Myfilename at 18 wf = webfigure(handle) ;
I tried to build the file using the tool, but i got error message telling:
unable to build the code....
How to solve this problem? Is there any fix for this? Thanks in advance
Sreenu https://sites.google.com/site/kolukulasivasrinivas/
0 件のコメント
採用された回答
Friedrich
2011 年 12 月 2 日
Hi,
where should the java application run at the end? Are you designing a web application or a classical java application?
A webfigure is designed to be displayed on a webpage, example here:
You can't translate a figure directly to a JAVA component. You can create the figure on the ML side, save it as a .fig and write a function which open that fig file. Than you compile that m file which can be executed from JAVA which will than show you the figure.
4 件のコメント
Friedrich
2011 年 12 月 3 日
did you put it in with that linebreak in the role? if so, it wont work I think. Please make sure that the <user username="sreenu" password="energy" roles="admin,manager-gui, manager-script"/> is one line without a break.
その他の回答 (2 件)
Kaustubha Govind
2011 年 12 月 1 日
I don't have any Java experience, but this is what I see in javawebfigure.m:
import com.mathworks.toolbox.javabuilder.internal.*; % for MWMCR
% get a reference to the current MCR
runtime = MWMCR.getCurrent();
So it looks like MATLAB cannot find the MWMCR class as expected in the com.mathworks.toolbox.javabuilder.internal.* package. I can see javabuilder.jar in $matlabroot/toolbox/javabuilder/jar/$arch - I'm assuming that this is what is required. Is the JAR file present in your MATLAB installation?
2 件のコメント
Kaustubha Govind
2011 年 12 月 2 日
Yes, it looks like you do have the correct files for R2010a (my answer mentions the directory structure for R2011b). Strange - I don't have any new ideas, sorry. If possible, you could try re-installing MATLAB to be sure it's not a corrupt install. If that doesn't work, try contacting Tech Support.
KSSV
2011 年 12 月 9 日
15 件のコメント
Friedrich
2011 年 12 月 16 日
Not sure what causes this. But in normally this error means that java can't find a calls for which it is looking for. In this case a class from the javabuilder.jar. Did you copy the javabuilder.jar in the lib subfolder of your Apache installation? You can check this in the netbeans project under Libraries -> Apache Tomcat -> javabuilder.jar.
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB Compiler SDK についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!