필터 지우기
필터 지우기

I have a 2400x2400 matrix that I would like to use as a mask for each layer of a 2400x2400x46 matrix. Since the matrix dimensions are not equal, I cannot do so by simply multiplying the mask matrix by the larger matrix. How might I do this?

조회 수: 1 (최근 30일)
I have a 2400x2400 matrix that I would like to use as a mask for each layer of a 2400x2400x46 matrix. Since the matrix dimensions are not equal, I cannot do so by simply multiplying the mask matrix by the larger matrix. How might I do this? The end goal is to have a 2400x2400x46 matrix that has "NaN" for all "NaN" values in the mask matrix.
Thank you.

채택된 답변

Image Analyst
Image Analyst 2012년 11월 29일
% Mask the image.
maskedHyperSpectralImage = bsxfun(@times, HyperSpectralImage, cast(mask,class(HyperSpectralImage)));
Note: the above is all one line of code.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by