Mapping pixels of two matrices

ε祈祈猫儿з 提交于 2019-12-02 10:07:12

Here is an option

  matrix_1 = matrix_2(:);

which copies the elements (all of them) of matrix_2 in one long column.

In your data you said that matrix_1 has two columns, you can add a further empty column by doing, for instance

  matrix_1  = [matrix_1 zeros(size(matrix_1))];

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!