- Back to Home »
- -Matris Çarpımı
Posted by : #m.mert
29 Mart 2013 Cuma
Matris Çarpımı
using System;
using System.Collections.Generic;using System.Linq;
using System.Text;
namespace Matris_Carpim
{
class Program
{
static void Main(string[] args)
{
int[,] matris_1 = { { 2, 5 }, { 3, 6 }, { 4, 5 } };//3x2 lik matris
int[,] matris_2 = { { 3, 7, 4 }, { 4, 1, 9 }};//2x3 lük matris
int[,] top=new int [3,3];//Çıkan sonuç 3x3 lük olacak
for(int i=0;i<3 ;i++)
{
for(int j=0;j<3 ;j++)
{
for(int k=0;k<2;k++)
top[i,j]+=matris_1[i,k]*matris_2[k,j];//Çarpımları
}
}
for (int l = 0; l < 3; l++)
{
for (int y = 0; y < 3; y++)
{
Console.Write("{0} ", top[l, y]);
}
Console.WriteLine();//Her Matris satırından sonra bir satır aşağı in
}
Console.ReadLine();
}
}
}