I need to calculate the percentage differences of all elements that are larger than 5 in two matrices (A and B). Both A and B have a size of 1000 x 500. I want my results C to be in the same size of 1000 x 500 as well, so that I could plot them on a contour.
Below are my code:
C = (A(Ind)-B(Ind))./B(Ind)*100;
Here is the problem. Even though both my matrix "A" and the index variable "Ind" have a size of 1000 x 500, A(Ind) becomes a column data. Therefore my C is a column data, instead of retaining its original set up of 1000 x 500. In this case, how could I do the calculation to ensure my results will be on the grid and with a size of 1000 x 500?