help-octave
[Top][All Lists]
Advanced

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

Re: printing trellis


From: Mike Miller
Subject: Re: printing trellis
Date: Tue, 5 Apr 2016 21:28:30 -0700
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Apr 05, 2016 at 17:22:54 +0200, Max wrote:
> Hi.
> 
> I've got problem with trellis structure returned by poly2trellis()
> function from communications package.
> 
> Simple example:
> t = poly2trellis(5, [23, 33]);
> 
> The output of printf ("%d %d\n", t.nextStates); and t.nextStates are
> completely different, while for t.outputs it's pretty-much the same.
> Both are 16x2 matrices.
> 
> The questions is - how do I print the content of both properly?
> 
> Pardon if that's something trivial but going through manual did not
> helped so far.

This actually has nothing to do with the trellis structure, but is the
way that the Octave printf functions work on array arguments.

Try the following:

  >> x = [1, 2; 3, 4]
  x =

     1   2
     3   4

  >> printf ("%d %d\n", x)
  1 3
  2 4

Octave simply traverses all arguments in order, and each array argument
is iterated over in column-major order.

I'm not sure if this is called out specifically in the manual, but this
section talks briefly about how matrices are interpreted by the printf
family of functions.

http://www.gnu.org/software/octave/doc/interpreter/Output-Conversion-for-Matrices.html

-- 
mike



reply via email to

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