Hiho, ich bins wieder. Steck mal wieder total fest, da das Program nicht das tut, was es soll. Diesesmal geht es um Matrizenmultiplikation mit 3 Stringgrids und 2D-Arrays.
Bekomme wieder die Fehlermeldung, das " kein geeigneter Gleitkommawert ist.
Warscheinlich wieder irgendein Anfängerfehler. *Sich schon mal selbst die hand an den kopf hau*
Delphi-Quellcode:
procedure TForm3.Matrixmul(Sender:TObject);
var matrixA: array of array of double;
matrixB: array of array of double;
matrixC: array of array of double;
a,b,c,i,j,k:integer;
begin
a:=StrToInt(EditA.Text);
b:=StrToInt(EditB.Text);
c:=StrToInt(Editb.Text);
SetLength(matrixA,a,b);
SetLength(matrixB,b,c);
SetLength(matrixc,a,c);
For i:= 0 to a-1 do
for j:= 0 to b-1 do
begin
matrixA[i,j]:=StrToFloat(SG1.Cells[i,j]);
end;
for i:= 0 to b-1 do
for j:= 0 to c-1 do
begin
MatrixB[i,j]:=StrToFloat(SG2.Cells[i,j]);
end;
for i := 0 to a-1 do
for j := 0 to c-1 do
for k := 0 to b-1 do
begin
matrixc[i,j] := matrixc[i,j] + (matrixa[i,k] * matrixb[k,j]);
SG3.Cells[i,j]:=FloatToStr(matrixc[i,j]);
end;
end;
Schon mal danke im Voraus für eure Hilfe.