Mercurial > octave
annotate scripts/general/num2str.m @ 4:b4df021f796c
[project @ 1993-08-08 01:26:08 by jwe]
Initial revision
author | jwe |
---|---|
date | Sun, 08 Aug 1993 01:26:08 +0000 |
parents | |
children | 16a24e76d6e0 |
rev | line source |
---|---|
4 | 1 function retval = num2str (x) |
2 | |
3 # usage: num2str (x) | |
4 # | |
5 # Format x as a string. | |
6 # | |
7 # See also: sprintf, int2str | |
8 | |
9 if (nargin == 1) | |
10 if (rows (x) == 1 && columns (x) == 1) | |
11 retval = sprintf ("%g", x); | |
12 else | |
13 error ("num2str: expecting scalar argument"); | |
14 endif | |
15 else | |
16 error ("usage: num2str (x)"); | |
17 endif | |
18 | |
19 endfunction |