home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / SRC.DI$ / MATTEST4.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-26  |  493 b   |  28 lines

  1. /*
  2.  *    MATTEST4
  3.  *
  4.  *    Simple program that illustrates how to call the MAT-file Library
  5.  *    from a C program.  
  6.  *
  7.  *    The example reads the Matrix "A" from one MAT-file and writes it 
  8.  *    out to another.
  9.  *    
  10.  */
  11. #include <stdlib.h>
  12. #include "mat.h"
  13.  
  14. main()
  15. {
  16.     MATFile *fp1, *fp2;
  17.     int m, n;
  18.     double *pr, *pi;
  19.  
  20.     fp1 = matOpen("foo.mat", "r");
  21.     fp2 = matOpen("foo1.mat", "w");
  22.     matGetFull(fp1, "A", &m, &n, &pr, &pi);
  23.     matPutFull(fp2, "A", m, n, pr, pi);
  24.     matClose(fp1);
  25.     matClose(fp2);
  26.     exit(0);
  27. }
  28.