Re: How to retrieve a column array from a 2-D array?
Posted: Thu Jun 19, 2014 2:55 pm
I use this:
on visualizzamatrix mat
#this visualize a bidimensional matrix like A x B
#rows
put the keys of mat into temp
sort lines of trow ascending numeric by word 1 of each #keys are random sometime
put the last line of temp into rows
#columns
put the keys of mat[1] into temp
sort lines of temp ascending numeric by word 1 of each #keys are random sometime
put the last line of temp into cols
# let's creat a simple text file
put empty into tmat
repeat with i = 1 to rows
repeat with j = 1 to cols
put mat[j] & "" after tmat
end repeat
put return after tmat
end repeat
answer tmat
end visualizzamatrix
Is it ok for you?
on visualizzamatrix mat
#this visualize a bidimensional matrix like A x B
#rows
put the keys of mat into temp
sort lines of trow ascending numeric by word 1 of each #keys are random sometime
put the last line of temp into rows
#columns
put the keys of mat[1] into temp
sort lines of temp ascending numeric by word 1 of each #keys are random sometime
put the last line of temp into cols
# let's creat a simple text file
put empty into tmat
repeat with i = 1 to rows
repeat with j = 1 to cols
put mat[j] & "" after tmat
end repeat
put return after tmat
end repeat
answer tmat
end visualizzamatrix
Is it ok for you?