Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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.


Comment on Re: How can I print out part of the matrix
Select or Download Code

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: (11)
As of 2014-12-29 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (190 votes), past polls