printfmt ============================================== Purpose ---------------- Prints character, numeric, or mixed matrix using a default format controlled by the functions formatcv and formatnv. Format ---------------- .. function:: retcode = printfmt(x, mask) :param x: matrix which is to be printed :type x: NxK matrix :param mask: 1 if *x* is numeric or 0 if *x* is character. - or - 1xK vector of 1's and 0's. The corresponding column of *x* will be printed as numeric where :math:`mask = 1` and as character where :math:`mask = 0`. :type mask: scalar :return retcode: 1 if the function is successful and 0 if it fails. :rtype retcode: scalar Examples ---------------- :: c1 = { "age", "height", "weight" }; c2 = { 31, 70, 160 }; // Horizontally concatenate c1 and c2 c = c1~c2; // Print 'c' as numeric data print c; // Print 'c' as character data print $c; // Print column 1 of 'c' as character data and column 2 as // numeric data // Note: call disregards the return value mask = { 0 1 }; call printfmt(c, mask); The output from the three different print statements will be: :: +DEN 31.000000 +DEN 70.000000 +DEN 160.00000 :: age height weight :: age 31 height 70 weight 160 Only the final print statement from :func:`printfmt` correctly prints both columns. Remarks ------- Default format for numeric data is: ``"*.*lg" 16 8`` Default format for character data is: ``"*.*s" 8 8`` Source ------ gauss.src Globals ------------ \__fmtcv, \__fmtnv .. seealso:: Functions :func:`formatcv`, :func:`formatnv`