help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatted print


From: Miquel Cabanas
Subject: Re: Formatted print
Date: Fri, 26 Jul 2002 11:20:33 -0500
User-agent: Mutt/1.3.28i

On Fri, Jul 26, 2002 at 10:50:55AM -0500, Dorci Smith wrote:
>  
> T       X
> 0.00    value  value
> 0.01    value  value
> ...
> 100.00  value  value

as stated in the octave manual, printf() will cycle through
the template untill all values in the matrix have been printed.

The fastest & easiest way is to build a matrix containing all
vectors & matrices you intend to print. Beware that matrices
are row-read, thus, if you begin with column-vectors you will
have to transpose the final matrix to get what you want. For
instance, you could create M as

> M = [ T X ]'
ans =

 Columns 1 through 5:

    1.000000   2.000000   3.000000   4.000000   5.000000
    0.239984   0.059694   0.685484   0.148572   0.102026
    
 Columns 6 through 10:

    ...
    ...

and then print it using

> printf ( '%f\t%f\t%f\n', M' )

1.000000        0.239984        0.214949
2.000000        0.059694        0.821710
3.000000        0.685484        0.509631
...
8.000000        0.572745        0.700116
9.000000        0.921823        0.710626
10.000000       0.930813        0.827124


voila!


Miquel


-- 
Miquel E Cabanas ------------------------------------------------------
SeRMN, Universitat Autonoma de Barcelona (address@hidden)
------------------------------------------o-oo--ooo---ooo--oo-o--------



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]