macbest
08-06-2008, 15:02
Hallo,
ich habe zwecks Matrixmultiplikation zwei Formulare für die jeweiligen Eingabewerte, also
a11 , a12, a13,
a21 , a22, a23,
a31 , a32, a33
und
b11 , b12, b13,
b21 , b22, b23,
b31 , b32, b33
in der Form
(Beispiel für b11)
<INPUT TYPE="text" NAME="b11" Value="b11" SIZE=2>
erzeugt.
Wie kann ich jetzt, wenn möglich per Schleife, auf meine 18 Werte zugreifen?
Ich möchte die Werte (a11 ...) mit folgender "Prozedur" bei einer Matrixmultiplikation verwerten:
$C=array(array(0,0,0),array(0,0,0),array(0,0,0));
for($i=0; $i<=2;$i++) {
for($j=0; $j<=2;$j++){
for($k=0; $k<=2;$k++) {
$C[$i][$j]=$C[$i][$j]+$A[$i][$k]*$B[$k][$j];
}
echo $C[$i][$j]. " ";
if ($j==2){
Gruß,
macbest
ich habe zwecks Matrixmultiplikation zwei Formulare für die jeweiligen Eingabewerte, also
a11 , a12, a13,
a21 , a22, a23,
a31 , a32, a33
und
b11 , b12, b13,
b21 , b22, b23,
b31 , b32, b33
in der Form
(Beispiel für b11)
<INPUT TYPE="text" NAME="b11" Value="b11" SIZE=2>
erzeugt.
Wie kann ich jetzt, wenn möglich per Schleife, auf meine 18 Werte zugreifen?
Ich möchte die Werte (a11 ...) mit folgender "Prozedur" bei einer Matrixmultiplikation verwerten:
$C=array(array(0,0,0),array(0,0,0),array(0,0,0));
for($i=0; $i<=2;$i++) {
for($j=0; $j<=2;$j++){
for($k=0; $k<=2;$k++) {
$C[$i][$j]=$C[$i][$j]+$A[$i][$k]*$B[$k][$j];
}
echo $C[$i][$j]. " ";
if ($j==2){
Gruß,
macbest