Mapping pixels of two matrices

前端 未结 2 665
无人共我
无人共我 2021-01-28 21:12

Say that I have two matrices of the following sizes:

matrix_1 = 30090x2

matrix_2 = 170x177

Assume here that the number of rows n

2条回答
  •  独厮守ぢ
    2021-01-28 21:41

    A fast way is first convert both matrix to column vector using the following command: matrix_1=matrix_1(:); matrix_2=matrix_2(:);

    And since both matrix now have the same size, you can perform wanted operations.

    If you need to restore the matrix to original scale, you can do it by using reshape command matrix_1=reshape(matrix_1, 30090,2)

    see following reference: http://www.mathworks.com/help/matlab/ref/reshape.html

提交回复
热议问题