Effacer les filtres
Effacer les filtres

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 vue (au cours des 30 derniers jours)
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.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by