Question

I'm new to octave and running into a formatting issue which I can't seem to fix. If I display a variable with multiple columns I get something along the lines of:

Columns 1 through 6:

        0.75883  0.93290  0.40064  0.43818  0.94958  0.16467

However what I would really like to have is:

0.75883  
0.93290  
0.40064  
0.43818
0.94958
0.16467

I've read the format documentation here but haven't been able to make the change. I'm running Octave 3.6.4 on Windows however I've used Octave 3.2.x on Windows and seen it output to the desired output by default.

To be specific, in case it matters, I am using the fir1 command as part of the signal package and these are sample outputs that I might see.

Was it helpful?

Solution

It sounds like, as Dan suggested, you want to display the transpose of your vector, i.e. a row vector rather than a column vector:

>> A = rand(1,20)
A =

 Columns 1 through 7:

   0.681499   0.093300   0.490087   0.666367   0.212268   0.456260   0.532721

 Columns 8 through 14:

   0.850320   0.117698   0.567046   0.405096   0.333689   0.179495   0.942469

 Columns 15 through 20:

   0.431966   0.100049   0.650319   0.459100   0.613030   0.779297

>> A'
ans =

   0.681499
   0.093300
   0.490087
   0.666367
   0.212268
   0.456260
   0.532721
   0.850320
   0.117698
   0.567046
   0.405096
   0.333689
   0.179495
   0.942469
   0.431966
   0.100049
   0.650319
   0.459100
   0.613030
   0.779297
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top