It keeps it in simplest form; however, to force it to a 1 by n array, do: z=:(0 : 0) 1 2 3 4 )
z2=:(0 : 0) 1 2 2 3 3 4 4 5 ) (,@".);._2 z 1 2 3 4 (,@".);._2 z2 1 2 2 3 3 4 4 5 On Sun, Apr 16, 2017 at 12:26 PM, Michael Goodrich < [email protected]> wrote: > All, > > In using 'readtable' as defined in the primer I find the following > situation: > > Reading in a square matrix from a file with each row of numbers on a line I > always get the 'correct' answer when asking about the shape of the read in > data, EXCEPT when the data has only one value per line ie is a vector or > de-generate matrix if you will. In that case the shape comes back with a > single number say N whereas I was expecting it to say 'N 1' and indeed the > read in data is not available for linear algebra operations whereas data > with more that one column is without further ado. > > Why does J not treat a column of numbers as a N by 1 'matrix' ie a vector > rather than a list? > > (Pardon me if I sound like I am whining ;-) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
