Thanks both of you. I am aware of the existence of those functions in
comercial Macsyma, but after changing my computer I have not been
able to start my Macsyma 422 anymore (on Linux). I was thinking that
the approach Barton suggested should be one, and was/am hoping that
perhaps somebody already did (or knows how to do) something like
that. What got me into this was some simulations that I did on
Scilab and Maxima several weeks ago. I will be back to play some
more with it in 4-5 weeks.
Milan Lukic
Dan Stanger [10/09/03 19:06 -0400]:
> The commercial Macsyma has the functions:
> READ_NUMERICAL_DATA,
> READ_NUM_DATA_TO_MATRIX and
> READ_NUM_DATA_TO_ARRAY.
> Perhaps for compatibility, they should be reproduced.
>
> Barton Willis wrote:
>
> > I'm unaware of a Maxima function that reads data from a file and
> > places the elements into a list or matrix. I'm assuming that the
> > motivation is to import data from a spreadsheet or some
> > other application.
> >
> > I can think of two approaches:
> >
> > (1) Define functions for reading a matrix, a list, and an array.
> > The read_matrix function would read a line of the file and place all
> > these elements in a matrix row; read_list would read elements and place
> > them
> > in a list (ignoring end of lines); read_array would be similar
> > to read_matrix --- it would only work for one or two dimensional arrays.
> >
> > (2) Define one function that reads items from a file and places each
> > item into a list. Then define a utility that converts a list to a
> > matrix (either row-by-row or column-by-column, the user gets to choose)
> > or an array.
> >
> > What do you all think? I suppose (1) might be better for reading matrices
> > because the user doesn't need to know the matrix size (it's determined by
> > how many elements are in each line). Or is there a Maxima function(s)
> > that does these things already?
> >
> > Barton
> >
> > P.S. I see that yesterday I used cvs when I meant csv. Funny.
> >
> > Milan Lukic <lmilan@shell.core.com>
> > Sent by: maxima-admin@math.utexas.edu
> > 09/09/2003 11:31 AM
> > Please respond to Milan Lukic
> >
> >
> > To: maxima@www.ma.utexas.edu
> > cc:
> > Subject: Re: [Maxima] saving as CSV, eigensystem
> >
> > e-mail from the Maxima list). I am also wondering if we could read a
> > data file into maxima, probably forming a matrix or an array. Say, you
> > have a file data.txt such as
> > 1 2 3
> > 4 5 6
> > 7 8 9
> > ....
> >
> > Milan Lukic
> >
> > _______________________________________________
> > Maxima mailing list
> > Maxima@www.math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> >
> > _______________________________________________
> > Maxima mailing list
> > Maxima@www.math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>