MATLAB: Matlab figure to jar file

deploytooljar filejavaMATLAB Compiler SDKmatlab plottoolbox

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/

Best Answer

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.