function jvdmatrixWrite(filename,X,floatfmt) %JVDMATRIXWRITE Writes a matrix to a file as a jvdmatrix. % % Arguments: % filename name of file to write to % X matrix to write % floatfmt precision [default: '%.16g'] % % Authors: % Joshua V. Dillon; Feb. 21, 2007; jvdillon AAT purdue DDOT edu if nargin==2 floatfmt = '%.16g'; end fd = fopen(filename,'w'); fprintf(fd,'%d %d\n',size(X)); fprintf(fd,[floatfmt '\n'],reshape(full(X),numel(X),1)); fclose(fd);