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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://171064]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-18 21:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found