writemat.m

来自「Lamda算法:GPS快速整周模糊度算法的核心」· M 代码 · 共 51 行

M
51
字号
function writemat (fid,text,matrix,format)%WRITEMAT: Write the contents of a matrix to a file%% Input arguments:%    fid:    File identifier:%            0: Do not write at all%            1: Write to screen (matlab default output)%            n: Write to file 'n', which should be be open%    text  : Descriptive text%    matrix: The matrix to be printed%    format: Format to be used, optional, default = "%15.5f"% ----------------------------------------------------------------------% File.....: writemat.m% Date.....: 19-MAR-1999% Author...: Peter Joosten%            Mathematical Geodesy and Positioning%            Delft University of Technology% ----------------------------------------------------------------------if nargin < 4; format = '%15.5f'; end;if fid ~= 0;   fprintf (fid,'%c',[text ':']);   fprintf (fid,'\n\n');   for i = 1:size(matrix,1);      for j = 1:size(matrix,2);         if size(format,1) < size (matrix,2);            fprintf (fid,format(1,:),matrix(i,j));         else;            fprintf (fid,format(j,:),matrix(i,j));         end;      end;      fprintf (fid,'\n');   end;   fprintf (fid,'\n');end;% ----------------------------------------------------------------------% End of routine: writemat% ----------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?