octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #46736] Resorting of cell delivers incorrect r


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #46736] Resorting of cell delivers incorrect result when stored in variable
Date: Mon, 21 Dec 2015 12:18:34 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Update of bug #46736 (project octave):

              Item Group:        Incorrect Result => Other                  
                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 
        Operating System:       Microsoft Windows => Any                    

    _______________________________________________________

Follow-up Comment #1:

For cell indexing, I like to point to the manual for a few examples:

https://www.gnu.org/software/octave/doc/interpreter/Indexing-Cell-Arrays.html#Indexing-Cell-Arrays

As you have seen in your code example ll{[2,1]} produces two "ans" variables.
It is not a single result! Using ans afterwards will only take the last of the
rows. To capture all the results from the cell indexing, try


>> lk=[ll{[2,1]}]
lk =

 Columns 1 through 14:

    3    8    1    2    9   10    6    5    7    4    1    2    3    4

 Columns 15 through 20:

    5    6    7    8    9    0


this produces a vector with all results. But, I guess, the more desired
outcome is 


lk = cell2mat (ll')
lk =

    1    2    3    4    5    6    7    8    9    0
    3    8    1    2    9   10    6    5    7    4


HTH, Kai

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46736>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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