Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How can I print out part of the matrix

by clintp (Curate)
on Jun 02, 2002 at 20:46 UTC ( #171064=note: print w/replies, xml ) Need Help??


in reply to How can I print out part of the matrix

The question is, do you know how to print the matrix at all? I'm going to assume you can, and if so instead of:
# pseudocode for row (0..rows) { for col (0..cols) { print array[row][col] } }
You substitute a list for the colums and rows you want to iterate over:
# pseudocode for row (@goodrows) { for col (@goodcols) { print array[row][col] } }


As an aside, this is interesting...
@gm=map { [ @$_[@goodcols] ] } @matrix[@goodrows];
Giving a matrix with only the good columns and rows in it. Hmm. Although I'd have preferred some kind of @matrix[@goodrows]->[@goodcols] syntax, but I'll have to wait for Perl 6 for that.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://171064]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2016-09-27 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (509 votes). Check out past polls.