product between 2 arrays of 2 dimensions and be the score is stored in another array using ecplise and gridsim
for exemple:
mat3[i][j]= mat1[i][j]* mat2[i][j]
chahinez.abdelo.9 0 Newbie Poster
Recommended Answers
Jump to Postfor(int r=0;r<numRows;r++) for(int c=0;c<numCols;c++) mat3[r][c]= mat1[r][c]* mat2[r][c];
Jump to Postjust add a few lines in your previous code
/* create a random generator with a seed */ Random randomGenerator=new Random(System.currentMillis()); for(int r=0;r<numRows;r++) { for(int c=0;c<numCols;c++) { mat1[r][c]=randomGenerator.nextInt(); mat2[r][c]=randomGenerator.nextInt(); mat3[r][c]= mat1[r][c]* mat2[r][c]; } }
are you trying to do is matrix multiplication?? then the loop will …
All 6 Replies
cool_zephyr 7 Junior Poster in Training
chahinez.abdelo.9 0 Newbie Poster
chahinez.abdelo.9 0 Newbie Poster
Labdabeta 182 Posting Pro in Training Featured Poster
cool_zephyr 7 Junior Poster in Training
chahinez.abdelo.9 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.