I don't know how do this. I know that there are 4 "for" statements...but how????? Can anyone help me...please.. If you don't know what I mean...
PS: Sorry for my English!
PS: Sorry for my English!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
int matrixA[3][2];
int matrixB[2][3];
int matrixC[3][3];
memset(matrixC,0,sizeof(int)*3*3);
int col = 0;
int row = 0;
for(int i = 0; i<3;i++)
{
for(int j = 0;j<2;j++)
{
matrixC[col][row]+= matrix[i][j];
col++;
if(col == 3)
{
col = 0;
row++;
}
}
}
sorry for the mis-interpretation, I got side tracked and thought you were asking how to do matrix multiplicaiton.
Matt
int matrixA[3][2];
int matrixB[2][3];
int matrixC[3][3];
memset(matrixC,0,sizeof(int)*3*3);
int col = 0;
int row = 0;
for(int i = 0; i<3;i++)
{
for(int j = 0;j<2;j++)
{
matrixC[col][row]+= matrix[i][j];
col++;
if(col == 3)
{
col = 0;
row++;
}
}
}