From: saikat on
Hello Guys,
Need you people help. Below you will find the Klein Bottle Code. But unfortunately when I try to package it with JA Compiler it doesn't work. Can any body say where lies the problem.
Hope I will not deprived of your kind favor.
kind regards
saikat

-----------------------CODE-------------------------------------------

%%Klein Bottle
% A klein bottle is nonorientable surface in four- dimentional
%A Klein bottle is a nonorientable surface in four-dimensional space. It is formed by attaching two Mobius strips along their common boundary.
%Klein bottles cannot be constructed without intersection in three-space.
%The figure shown is an example of such a self-intersecting Klein bottle.
function [a,b,c] = Klein_Bottle_JavaCode();
%%Genearte The Klien Bottle
n = 12;
a = .2; % the diameter of the small tube
c = .6; % the diameter of the bulb
t1 = pi/4 : pi/n : 5*pi/4; % parameter along the tube
t2 = 5*pi/4 : pi/n : 9*pi/4; % angle around the tube
u = pi/2 : pi/n : 5*pi/2;
[X,Z1] = meshgrid(t1,u)
[Y,Z2] = meshgrid(t2,u);
% The handle
len = sqrt(sin(X).^2 + cos(2*X).^2);
x1 = c*ones(size(X)).*(cos(X).*sin(X) ...
- 0.5*ones(size(X))+a*sin(Z1).*sin(X)./len);
y1 = a*c*cos(Z1).*ones(size(X));
z1 = ones(size(X)).*cos(X) + a*c*sin(Z1).*cos(2*X)./len;
handleHndl=surf(x1,y1,z1,X);
set(handleHndl,'EdgeColor',[.5 .5 .5]);
hold on;

%% The bulb
r = sin(Y) .* cos(Y) - (a + 1/2) * ones(size(Y));
x2 = c * sin(Z2) .* r;
y2 = - c * cos(Z2) .* r;
z2 = ones(size(Y)) .* cos(Y);
bulbHndl=surf(x2,y2,z2,Y);
set(bulbHndl,'EdgeColor',[.5 .5 .5])
colormap(hsv);
axis vis3d
view(-37,30);
axis off
light('Position',[2 -4 5])
light
hold off
a = webfigure(handle);

%% Half of The Bottle
shading interp
c = X;
[row col] = size(c);
c(1:floor(row/2),:) = NaN*ones(floor(row/2),col);
set(handleHndl,'CData',c);
c = Y;
[row col] = size(c);
c(1:floor(row/2),:) = NaN*ones(floor(row/2),col);
set(bulbHndl,'CData',c);
set([handleHndl bulbHndl],'FaceAlpha',1);

b = webfigure(handle);

%% Transparent Bottle
shading faceted;
set(handleHndl,'CData',X);
set(bulbHndl,'CData',Y);
set([handleHndl bulbHndl], ...
'EdgeColor',[.5 .5 .5], ...
'FaceAlpha',.5);
c = webfigure(handle);
close(handle);
From: Ross W on
"saikat " <saika_kamal(a)hotmail.com> wrote in message <i3k2tn$mgo$1(a)fred.mathworks.com>...
> Hello Guys,
> Need you people help. Below you will find the Klein Bottle Code. But unfortunately when I try to package it with JA Compiler it doesn't work. Can any body say where lies the problem.
> Hope I will not deprived of your kind favor.
> kind regards
> saikat
>
> -----------------------CODE-------------------------------------------
>
> %%Klein Bottle
> % A klein bottle is nonorientable surface in four- dimentional
> %A Klein bottle is a nonorientable surface in four-dimensional space. It is formed by attaching two Mobius strips along their common boundary.
> %Klein bottles cannot be constructed without intersection in three-space.
> %The figure shown is an example of such a self-intersecting Klein bottle.
> function [a,b,c] = Klein_Bottle_JavaCode();
> %%Genearte The Klien Bottle
> n = 12;
> a = .2; % the diameter of the small tube
> c = .6; % the diameter of the bulb
> t1 = pi/4 : pi/n : 5*pi/4; % parameter along the tube
> t2 = 5*pi/4 : pi/n : 9*pi/4; % angle around the tube
> u = pi/2 : pi/n : 5*pi/2;
> [X,Z1] = meshgrid(t1,u)
> [Y,Z2] = meshgrid(t2,u);
> % The handle
> len = sqrt(sin(X).^2 + cos(2*X).^2);
> x1 = c*ones(size(X)).*(cos(X).*sin(X) ...
> - 0.5*ones(size(X))+a*sin(Z1).*sin(X)./len);
> y1 = a*c*cos(Z1).*ones(size(X));
> z1 = ones(size(X)).*cos(X) + a*c*sin(Z1).*cos(2*X)./len;
> handleHndl=surf(x1,y1,z1,X);
> set(handleHndl,'EdgeColor',[.5 .5 .5]);
> hold on;
>
> %% The bulb
> r = sin(Y) .* cos(Y) - (a + 1/2) * ones(size(Y));
> x2 = c * sin(Z2) .* r;
> y2 = - c * cos(Z2) .* r;
> z2 = ones(size(Y)) .* cos(Y);
> bulbHndl=surf(x2,y2,z2,Y);
> set(bulbHndl,'EdgeColor',[.5 .5 .5])
> colormap(hsv);
> axis vis3d
> view(-37,30);
> axis off
> light('Position',[2 -4 5])
> light
> hold off
> a = webfigure(handle);
>
> %% Half of The Bottle
> shading interp
> c = X;
> [row col] = size(c);
> c(1:floor(row/2),:) = NaN*ones(floor(row/2),col);
> set(handleHndl,'CData',c);
> c = Y;
> [row col] = size(c);
> c(1:floor(row/2),:) = NaN*ones(floor(row/2),col);
> set(bulbHndl,'CData',c);
> set([handleHndl bulbHndl],'FaceAlpha',1);
>
> b = webfigure(handle);
>
> %% Transparent Bottle
> shading faceted;
> set(handleHndl,'CData',X);
> set(bulbHndl,'CData',Y);
> set([handleHndl bulbHndl], ...
> 'EdgeColor',[.5 .5 .5], ...
> 'FaceAlpha',.5);
> c = webfigure(handle);
> close(handle);

Hi

You need to tell us what you mean by 'it doesn't work'.

Were there error messages at runtime? compile time? What were the messages?
Does your code run properly inside Matlab?

Can you successfully compile and run a trivial ("Hello World") program or some demo code?

Ross
From: saikat on
Dear Ross,
Thanks for your kind and quick reply and suggestions. Below you will find the error message which I am getting in the Deployment Tool Output. Actually error occured while shelling out to javac.
Looking forward to ur reply.
Kind regards,
saikat

---------------------------Error Message---------------------------------------------------------

mcc -W 'java:class,Class' -d 'D:\MATLAB\data_analysis\Klein_bottle\class\src' -T 'link:lib' -v 'class{Class:D:\MATLAB\data_analysis\Klein_bottle\Klein_Bottle_JavaCode.m}'
Compiler version: 4.10 (R2009a)
Processing include files...
2 item(s) added.
Processing directories installed with MCR...
The file D:\MATLAB\data_analysis\Klein_bottle\class\src\mccExcludedFiles.log contains a list of functions excluded from the CTF archive.
2 item(s) added.
Generating MATLAB path for the compiled application...
Created 41 path items.
Begin validation of MEX files: Sun Aug 08 10:01:58 2010
End validation of MEX files: Sun Aug 08 10:01:58 2010
Parsing file "D:\MATLAB\data_analysis\Klein_bottle\Klein_Bottle_JavaCode.m"
(Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\deployprint.m"
(Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\printdlg.m"
(Referenced from: "Compiler Command Line").
Deleting 0 temporary MEX authorization files.
Generating file "D:\MATLAB\data_analysis\Klein_bottle\class\src\readme.txt".
Executing command: "javac -verbose -classpath "C:\Program Files\MATLAB\R2009a\toolbox\javabuilder\jar\javabuilder.jar" -d "D:\MATLAB\data_analysis\Klein_bottle\class\src\classes" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\Class.java" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\ClassMCRFactory.java" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\ClassRemote.java" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\package-info.java""
'javac' is not recognized as an internal or external command,
operable program or batch file.
Error: An error occurred while shelling out to javac (error code = 1).
Unable to build executable.
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).


There were errors during compilation process.
From: Ross W on
"saikat " <saika_kamal(a)hotmail.com> wrote in message <i3lcu3$e2v$1(a)fred.mathworks.com>...
> Dear Ross,
> Thanks for your kind and quick reply and suggestions. Below you will find the error message which I am getting in the Deployment Tool Output. Actually error occured while shelling out to javac.
> Looking forward to ur reply.
> Kind regards,
> saikat
>
> ---------------------------Error Message---------------------------------------------------------
>
> mcc -W 'java:class,Class' -d 'D:\MATLAB\data_analysis\Klein_bottle\class\src' -T 'link:lib' -v 'class{Class:D:\MATLAB\data_analysis\Klein_bottle\Klein_Bottle_JavaCode.m}'
> Compiler version: 4.10 (R2009a)
> Processing include files...
> 2 item(s) added.
> Processing directories installed with MCR...
> The file D:\MATLAB\data_analysis\Klein_bottle\class\src\mccExcludedFiles.log contains a list of functions excluded from the CTF archive.
> 2 item(s) added.
> Generating MATLAB path for the compiled application...
> Created 41 path items.
> Begin validation of MEX files: Sun Aug 08 10:01:58 2010
> End validation of MEX files: Sun Aug 08 10:01:58 2010
> Parsing file "D:\MATLAB\data_analysis\Klein_bottle\Klein_Bottle_JavaCode.m"
> (Referenced from: "Compiler Command Line").
> Parsing file "C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\deployprint.m"
> (Referenced from: "Compiler Command Line").
> Parsing file "C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\printdlg.m"
> (Referenced from: "Compiler Command Line").
> Deleting 0 temporary MEX authorization files.
> Generating file "D:\MATLAB\data_analysis\Klein_bottle\class\src\readme.txt".
> Executing command: "javac -verbose -classpath "C:\Program Files\MATLAB\R2009a\toolbox\javabuilder\jar\javabuilder.jar" -d "D:\MATLAB\data_analysis\Klein_bottle\class\src\classes" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\Class.java" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\ClassMCRFactory.java" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\ClassRemote.java" "D:\MATLAB\data_analysis\Klein_bottle\class\src\class\package-info.java""
> 'javac' is not recognized as an internal or external command,
> operable program or batch file.
> Error: An error occurred while shelling out to javac (error code = 1).
> Unable to build executable.
> ??? Error using ==> mcc
> Error executing mcc, return status = 1 (0x1).
>
>
> There were errors during compilation process.

Hi

Key error message is "'javac' is not recognized as an internal or external command, operable program or batch file."

I don't know exactly what the solution is because I don't use this compiler.

But you need to (i) locate javac.exe on your computer (ii) find out which path is being used by the compiling process, and make sure it includes the location of javac.exe

Others may be able to more specific help

Ross