00001 import javasci.* ;
00002
00003
00004 class Exemple9 {
00005
00006 public static void main(String[] args) {
00007 int col=4;
00008 int row=2;
00009 int r,c;
00010 double [] b=new double[row*col];
00011
00012
00013 SciComplexArray a = new SciComplexArray("A",row,col);
00014 Scilab.Exec("A=[ 1. + 10*%i,2. + 20*%i,3. + 30*%i ,4. + 40*%i; 5. + 50*%i,6. + 60*%i,7. + 70*%i ,8. + 80*%i]");
00015 System.out.println("----------------------------------------------------");
00016 a.disp();
00017 System.out.println("----------------------------------------------------");
00018 for(r=1;r<=a.getRow();r++)
00019 {
00020 for(c=1;c<=a.getCol();c++)
00021 {
00022 System.out.print("A("+(r)+","+(c)+")="+a.GetRealPartElement(r,c)+" "+a.GetImaginaryPartElement(r,c)+" ");
00023 }
00024 System.out.println(" ");
00025 }
00026 System.out.println("----------------------------------------------------");
00027 SciComplexArray s = new SciComplexArray("S",1,4,new double [] {1,2,3,4},new double [] {5,6,7,8});
00028 s.disp();
00029 System.out.println("----------------------------------------------------");
00030 SciComplexArray sp = new SciComplexArray("S",1,4);
00031 sp.disp();
00032 System.out.println("----------------------------------------------------");
00033 Scilab.Finish();
00034
00035 }
00036 }
00037