3D matrix manipulation. FInd values of given positions

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

I think the page as follows will help you.
Try the functions nonzeros, find and sum to slove your problem.

댓글을 달려면 로그인하십시오.

 채택된 답변

lvn
lvn 2014년 5월 8일
This should do it:
sum(matrix2(matrix1~=0))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

질문:

2014년 5월 8일

답변:

lvn
2014년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by