Exemple7A.java

Go to the documentation of this file.
00001 /* Allan CORNET INRIA 2006 */
00002 import java.io.*;
00003 import javasci.*; 
00004 
00005 public class  Exemple7A {
00006 
00007   public static void main(String[] args)
00008   {
00009         int col=4;
00010           int row=2;
00011           int r,c;
00012           double [] b=new double[row*col];
00013           
00014           SciDoubleArray a = new SciDoubleArray("A",row,col);
00015           Scilab.Exec("A=[1,2,3,4;5 6 7 8];");
00016                 a.Get();
00017                 b=a.getData();
00018                 
00019                 System.out.println("Exemple 7 A Serialize");
00020                 System.out.println("----------------------------------------------------");
00021         for(r=0;r<=(a.getRow()*a.getCol())-1;r++)
00022     {
00023        System.out.print(""+b[r]+"  ");
00024     }
00025     System.out.println("");
00026         System.out.println("----------------------------------------------------");
00027         
00028                 try 
00029     {
00030         FileOutputStream fichier = new FileOutputStream("Exemple7.ser");
00031         ObjectOutputStream oos = new ObjectOutputStream(fichier);
00032         oos.writeObject(a);
00033         oos.flush();
00034         oos.close();
00035         }
00036         
00037     catch (java.io.IOException e) 
00038     {
00039       e.printStackTrace();
00040     }
00041     
00042     Scilab.Finish();
00043     
00044   }
00045 }

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