Global Index (short | long) | Local contents | Local Index (short | long)
list = write_list ( y, ndigit ) ;
function list = write_list ( y, ndigit ) ; Writes the variable "y" out as strings of length "ndigit" This routine was probably written by Alexis Lau (there was no documentation). ---------------------------------------------------- I replaced the statement "elseif round(fmt) == fmt" with "elseif round(ndigit) == ndigit", which makes sense. The inconsistency of the previous version of this code causes a MATLAB version 5 error. ---------------------------------------- Todd Mitchell, July 1997
This function is called by | |
---|---|
function list = write_list ( y, ndigit ) ; if ( nargin < 2 ); ndigit=5; end; [m,n] = size(y); if isstr(ndigit); fmt = ndigit; elseif round(ndigit) == ndigit; fmt = [ '%' int2str(ndigit) 'g' ]; else fmt = [ '%' num2str(ndigit) 'g' ]; end list = sprintf(fmt,y(1)); for i = 2 : m*n; list = [ list sprintf(fmt,y(i)) ]; end;