home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1989 July / 64er_Magazin_89-07_1989_Markt__Technik_de_Side_A.d64 / matrix-mult (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  790b  |  51 lines

  1. 3 :
  2. 4 rem matrizenmultiplikation
  3. 5 rem (w) volker reichard
  4. 6 rem (c) 64'er
  5. 7 :
  6. 10 dima(10,10),b(10,10),c(10,10)
  7. 20 :
  8. 30 input"zeilen matrix a";z1
  9. 35 input"spalten        ";s1:print
  10. 40 input"zeilen matrix b";z2
  11. 45 input"spalten        ";s2
  12. 47 print
  13. 50 :
  14. 55 ifs1<>z2thenprint"produkt nicht bildbar!":end
  15. 60 :
  16. 62 print"matrix a"
  17. 65 forzi=1toz1:print"zeile";zi
  18. 70 forsi=1tos1
  19. 75 inputa(zi,si)
  20. 80 nextsi,zi
  21. 85 :
  22. 90 print:print"matrix b"
  23. 95 forzi=1toz2:print"zeile";zi
  24. 100 forsi=1tos2
  25. 105 inputb(zi,si)
  26. 110 nextsi,zi
  27. 115 :
  28. 116 forz=1tos2
  29. 118 fory=1toz1
  30. 120 forx=1tos1
  31. 125 s(y,z)=a(y,x)*b(x,z)
  32. 130 c(y,z)=c(y,z)+s(y,z)
  33. 135 nextx,y,z
  34. 136 print
  35. 137 :
  36. 140 print"matrix a"
  37. 142 forzi=1toz1
  38. 145 forsi=1tos1
  39. 150 printa(zi,si);
  40. 155 nextsi:print:nextzi
  41. 160 print:print"matrix b"
  42. 165 forzi=1toz2
  43. 170 forsi=1tos2
  44. 175 printb(zi,si);
  45. 180 nextsi:print:nextzi
  46. 185 print:print"produkt a*b"
  47. 190 forzi=1toz1
  48. 195 forsi=1tos2
  49. 200 printc(zi,si);
  50. 205 nextsi:print:nextzi
  51.