0
Matrix arrays Java
Hi. Supposing I have a 2 x 3 matrix with only 1 or 0 in the positions, and in each position we want to print another 2 x 2 matrix of the same characteristics; resulting in a new 4 x 6 matrix; how can I assign the value of the first matrix to each position of the final one? Example 010 ———-> 001100 001100 010 001100 001100
3 odpowiedzi
+ 1
copy first to second, but in second add each value twice and at the end of row duplicate last row
0
and how can I “compare” the two arrays without using for for for for? Is there any way to do it without having the second one in the same bucle?
0
if your matrix has target size, you can copy
0,1 -> 0,3| 1,3
1,1 -> 2,3| 3,3
...
at the end make copy of each new row and fill empty lines