From help-octave-request at bevo dot che dot wisc dot edu Fri Nov 29 15:03:37 2002 Subject: Re: How can I increase or decrise the lenth os scaling ! From: Mike Miller To: "John W. Eaton" cc: Help-Octave List Date: Fri, 29 Nov 2002 15:03:11 -0600 (CST) On Fri, 29 Nov 2002, John W. Eaton wrote: > On 29-Nov-2002, Mike Miller wrote: > > | I know that JWE and others are very busy, but I wonder what you all think > | of the following idea: > | > | format n.m > | > | where n,m are integers. m expresses the *exact* number of digits to be > | displayed to the right of the decimal point and n expresses the *maximum* > | number of digits to the left. > > Have you looked at the variables output_max_field_width and > output_precision? Not until now. Thanks for pointing them out. Very nice. > I know they don't allow you to specify precisely the number of digits to > the left and right of the decimal point, but they do allow better > control than just format short/long. > > My reason for specifying precision rather than just a number of digits > left and right of the decimal point was so that the small values in a > matrix with a wide range of values would not be printed as zeros. For > example, Matlab will do things like this: > > >> [1; 0.00001234] > > ans = > > 1.0000 > 0.0000 > > > and I wanted to avoid that. I like your thinking on that. You always display the first few significant digits. That's an excellent default, and especially useful for exploratory work where one is unsure of the possible range of values. It is still often the case that the 'ans' you show above would be preferred to the one produced by Octave, it just depends on what the numbers are being used for. So I think fixed format would be helpful. How about this as a strategy? (in case anyone wants to actually code this, I really don't have the skills) -- Instead of "format n.m" just use "format fixed" and have it use the values of output_max_field_width and output_precision in the following way... output_precision=m; output_max_field_width=n+m+1; format fixed ...and that would produce the "format n.m" I wrote about previously. The user would have to specify both output_precision and output_max_field_width or accept the current default values. Is this worthwhile enough that someone will want to do the coding work? Mike ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------