write_wfile(fname) writes a vector into a binary 'w' file fname - name of file to write to lvals - vector of values to be written lnums - vector of vertex indices
This function calls:
This function is called by:
0001 function write_wfile(lnums, lvals, fname) 0002 0003 % 0004 % write_wfile(fname) 0005 % writes a vector into a binary 'w' file 0006 % fname - name of file to write to 0007 % lvals - vector of values to be written 0008 % lnums - vector of vertex indices 0009 % 0010 0011 0012 % open it as a big-endian file 0013 fid = fopen(fname, 'wb', 'b') ; 0014 if (fid < 0) 0015 %%str = sprintf('could not open w file %s.', fname) ; 0016 %%error(str) ; 0017 oops(158); 0018 end 0019 vnum = length(lnums) ; 0020 latency = 0; 0021 0022 fwrite(fid, 1, 'int16') ; 0023 fwrite3(fid, vnum) ; 0024 for i=1:vnum 0025 fwrite3(fid, lnums(i)); 0026 fwrite(fid, lvals(i), 'float') ; 0027 end 0028 0029 fclose(fid) ; 0030 0031 0032 0033 0034 0035