xref: /petsc/src/dm/tests/ex12.m (revision 030f984af8d8bb4c203755d35bded3c05b3d83ce)
1function ex12(np,opt)
2%
3% From Matlab run  ex12(np)
4%
5% ex12.c creates a series of vectors in PETSc and displays them in Matlab
6%
7% Run with option -on_error_attach_debugger to debug
8%
9%  Requires the Matlab mex routines in ${PETSC_DIR}/share/petsc/matlab and ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab
10%  to create these run ./configure --with-matlab
11%
12%  Make sure that ${PETSC_DIR}/share/petsc/matlab and ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/matlab is in your MATLABPATH or
13%  $prefix/share/petsc/matlab and $prefix/lib/petsc/matlab if you ran ./configure with --prefix
14%
15if (nargin < 1)
16  np = 1;
17end
18if (nargin < 2)
19  opt = ' ';
20end
21time = 20;
22launch(['./ex12 -time ' int2str(time)  opt],np);
23
24p = PetscOpenSocket;
25for i=1:time,
26  v = PetscBinaryRead(p);
27  plot(v);
28  pause(1);
29end;
30close(p);
31