I have a 16X16 matrix. I have to add it to a 256X256 matrix. Can anyone help me how to make this 16X16 matrix into 256X256 filling the remaining with zeros?
First thing to do is create an output matrix that is 256x256, assuming you want to keep the original 256x256 matrix pristine. Next, move the values of the input 256x256 matrix into the output matrix. The next step is to add in the 16x16 elements to the output matrix.
But, before anyone can really answer this, you need to explain how the 16x16 matrix relates to the 256x256 matrix. In other words, is the first element (0,0) of the 16x16 matrix going to be added to the first element (0,0) of the 256x256 matrix? How about the secound element of (0, 1) - do you know where that is going to be added in? What about element (1, 0) of the 16x16 matrix - what element of the 256x256 matrix does that get added into? Once you figure this out, you should be able to simply code some loops to add in each element of the 16x16 matrix to the appropriate 256x256 output matrix element.