Exemple5.java

Go to the documentation of this file.
00001 import javasci.* ; 
00002 
00003 class  Exemple5 {
00004 
00005   public static void main(String[] args) 
00006   {
00007         int col=4;
00008         int row=2;
00009         int r,c,k;
00010         String [] b=new String [row*col];
00011         String [] d=new String[row*col];
00012         
00013         SciStringArray a = new SciStringArray("A",row,col);
00014         Scilab.Exec("A=['Aaa','Bbb','Ccc','Ddd';'Eee','Fff','Ggg','Hhh'];");
00015         a.Get();
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 
00041                 
00042                 for (k=0;k<row*col;k++)
00043                 {
00044                         d[k]=new String("Sentence ")+k;
00045                 }
00046                 
00047                 SciStringArray D = new SciStringArray("D",2,4,d);
00048                 D.disp();
00049                 
00050                 SciStringArray Dp = new SciStringArray("D",2,4);
00051                 Dp.disp();
00052                 
00053                 Scilab.Finish();
00054 
00055         
00056     
00057   }
00058 }
00059 

Generated on Sun Mar 4 15:03:58 2007 for Scilab [trunk] by  doxygen 1.5.1