madM has asked for the wisdom of the Perl Monks concerning the following question:
the rest of the numbers are 0.1111A => A 6.8888 B => B 6.8888 C => C 6.8888 D => D 6.8888
Hereīs what im trying to get:my @letters=qw(A B C D); print ' '; foreach my $key (@letters){ printf ("%s", $key); } "\n"; foreach my $key (@letters) { print $key,' '; foreach my $key2 (@letters) { printf ("%.1f" , $A->{$key}->{$key2}); } print "\n"; } }
A B C D A 6.8 0.1 0.1 0.1 B 0.1 6.8 0.1 0.1 C 0.1 0.1 6.8 0.1 D 0.1 0.1 0.1 6.8
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to printf a matrix like this
by RichardK (Parson) on Feb 11, 2014 at 11:46 UTC | |
by kcott (Archbishop) on Feb 12, 2014 at 09:22 UTC | |
by madM (Beadle) on Feb 11, 2014 at 12:12 UTC | |
|
Re: how to printf a matrix like this
by Anonymous Monk on Feb 11, 2014 at 11:11 UTC | |
| |
|
Re: how to printf a matrix like this
by McA (Priest) on Feb 11, 2014 at 11:09 UTC |