00001 import javasci.* ;
00002
00003
00004 class BooleanArray {
00005
00006 public static void main(String[] args) {
00007 int col=4;
00008 int row=2;
00009 int r,c;
00010 boolean [] b=new boolean[row*col];
00011
00012 SciBooleanArray a = new SciBooleanArray("A",row,col);
00013 SciBooleanArray bsci = new SciBooleanArray("B",row,col);
00014
00015 Scilab.Exec("A=[%t,%t,%t,%f;%f %t %t %t];");
00016 System.out.println("----------------------------------------------------");
00017 a.disp();
00018 System.out.println("----------------------------------------------------");
00019 for(r=1;r<=a.getRow();r++)
00020 {
00021 for(c=1;c<=a.getCol();c++)
00022 {
00023 System.out.print("A("+(r)+","+(c)+")="+a.GetElement(r,c)+" ");
00024 }
00025 System.out.println(" ");
00026 }
00027 System.out.println("----------------------------------------------------");
00028
00029 b=a.getData();
00030
00031 for(r=0;r<row;r++)
00032 {
00033 for(c=0;c<col;c++)
00034 {
00035 System.out.print("b("+r+","+(c)+")="+ b[c*row+r] +" ");
00036 }
00037 System.out.println(" ");
00038 }
00039 System.out.println("----------------------------------------------------");
00040 Scilab.Exec("B=~A;");
00041 bsci.disp();
00042 System.out.println("----------------------------------------------------");
00043 System.out.println("A ScilabType : "+Scilab.TypeVar("A"));
00044 System.out.println("B ScilabType : "+Scilab.TypeVar("B"));
00045 System.out.println("----------------------------------------------------");
00046 Scilab.Finish();
00047 }
00048 }
00049