Arsip: tanya eror matrix
more 12 years ago
diandewi
halo para master... bisa bantu benerin erornya dari code saya. erornya kyk gini:
[DCC Error] Question19653Project1Unit1.pas(118): E2064 Left side cannot be assigned to.
pada baris ini
Ref[0][J] := Ref[0][J]+ alpha(Ref[0][J]-Matrix[I,J]);
for K := 0 to 1 do //for each reference
begin
Memo1.Lines.Add('Reference: '+IntToStr(K));
for I := 0 to 9 do //for each row
begin
X := 0;
for J := 0 to 9 do //for each column
X := X+Power(Ref[K,J]-Matrix[I,J], 2);
X := Sqrt(X);
EuclDist[K,I]:= X;
Memo1.Lines.Add( Format('%0:20.18f',[X] ));
end;
Memo1.Lines.Add('');
end;
//end;
for I := 0 to 9 do
begin
if ((EuclDist[0][I]) < (EuclDist[1][I]))or ((EuclDist[0][I]) = (EuclDist[1][I])) then
begin
target:=0 ;
for j:= 0 to 9 do
if target=(matrix[i][j]) then
begin
Ref[0][J] := Ref[0][J]+ alpha (Ref[0][J]-Matrix[I,J]);
end
else
begin
Ref[0][J] := Ref[0][J]- alpha*(Ref[0][J]-Matrix[I,J]);
end;
end;
more 12 years ago
halimanh
Ref itu di deklarasinya sebagai constant yah?
const
ref [a, b] = array of ...
Kalo const itu artinya tetap, nggak bisa dirubah. Kalo ref mau dirubah-rubah, didekarasikan sebagai variable
var
ref [a , b] : array of ...
more 12 years ago
diandewi
oiya bener....setelah saya ubah jadi var langsung mau :)
trus saya mau nanya lg satu
di code ini
for I := 0 to 9 do
begin
if ((EuclDist[0][I]) < (EuclDist[1][I]))or ((EuclDist[0][I]) = (EuclDist[1][I])) then
begin
target:=0 ;
for j:= 0 to 9 do
if target=(matrix[i][9]) then
begin
pas baris f target=(matrix[i][9]) then
mksdnya jika target = matrix ke i kolom terakhir dimana matrixnya berukuran 10x10. apa bener kyk gt codenya? ato salah?
more 12 years ago
halimanh
Yah tergantung indeksnya, kalo indeknya 0 sampe 9, berarti 9 itu kolom terakhir. Kalo indeknya 1 sampe 10, 10 itu kolom terakhir.
more 12 years ago
diandewi
ya, indexnya 0 sampe 9 dan saya mau manggil kolom ke sembilan dari tiap2 baris..
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- crystal report 1/2 halaman
by jalu in Hal umum tentang Pascal Indonesia more 17 years ago - DElphi For PHP
by umarbakri in Hal umum tentang Pascal Indonesia more 17 years ago - Dumping MySQL
by n3o_cybertech in MySQL more 16 years ago - VK_Down
by belajaraja in Tip n Trik Pemrograman more 16 years ago - Aplikasi nutup secara otomatis
by fatahjunaidi in Hal umum tentang Pascal Indonesia more 19 years ago - [ASK] Fungsi untuk memanggil SLIDE dari Power Point
by RoenZ in Tip n Trik Pemrograman more 16 years ago - Keyboard Character?Help
by Durman in Hal umum tentang Pascal Indonesia more 16 years ago - Error Stack Overflow pd TQRDBChart
by klephoon in Reporting more 17 years ago - Delphi di Win Vista
by IdrisZZ in Hal umum tentang Pascal Indonesia more 16 years ago - send data paralalel ke Adotabel
by kakaManiez in Enginering more 17 years ago