<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">A simple way to proceed is to use <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerBinaryOpen.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerBinaryOpen.html</a><div><br><div><div>On Jul 27, 2014, at 10:18 AM, Sun, Hui <<a href="mailto:hus003@ucsd.edu">hus003@ucsd.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I try to create some binary output for MATLAB with the following code. <br><br>PetscViewer viewer = PETSC_VIEWER_BINARY(PETSC_COMM_WORLD);<br>MatView(A,viewer);<br>VecView(v,viewer);<br>PetscViewerDestroy(&viewer);<br><br>However it gives me an error, which is the following:<br><br>interface_fs.c:215:26: warning: implicit declaration of function 'PETSC_VIEWER_MATLAB' is invalid in C99 [-Wimplicit-function-declaration]<br> PetscViewer viewer = PETSC_VIEWER_MATLAB(PETSC_COMM_WORLD);<br> ^<br>interface_fs.c:215:17: warning: incompatible integer to pointer conversion initializing 'PetscViewer' (aka 'struct _p_PetscViewer *') with an expression of type 'int'<br> [-Wint-conversion]<br> PetscViewer viewer = PETSC_VIEWER_MATLAB(PETSC_COMM_WORLD);<br><br><br>I'm wondering what is the correct way to do this? Thank you! </blockquote></div><br></div></body></html>