3D matrix manipulation. FInd values of given positions

1 vue (au cours des 30 derniers jours)
André Sousa
André Sousa le 8 Mai 2014
Réponse apportée : lvn le 8 Mai 2014
Hi there. Pls help me resolve an issue I cant find a solution for: I have a two 3D matrixes with the same dimentions( 288*288*80)off nii files. I want to search for nonzero positions on the first matrix and use thoses positions to go through the second matrix, and do a sum of the values located on those positions . How can I do it? Regards
  1 commentaire
SkyRazor
SkyRazor le 8 Mai 2014
I think the page as follows will help you.
Try the functions nonzeros, find and sum to slove your problem.

Connectez-vous pour commenter.

Réponse acceptée

lvn
lvn le 8 Mai 2014
This should do it:
sum(matrix2(matrix1~=0))

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