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 件のコメント

SkyRazor
SkyRazor 2014 年 5 月 8 日
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 日

0 投票

This should do it:
sum(matrix2(matrix1~=0))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing 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