New matrix creation based on 2 existing matrices
古いコメントを表示
I have 2 matrices, a binary matrix representing data points (A) and the other with colour values for each trial (B). Both matrices are equal size. What I am trying to do is create a new matrix that contains the colour value from (B) wherever there is a 1 in (A) and NaN wherever there is a 0.
I am having trouble figure out how to properly map the two matrices together though. I have tried putting C(k,:) = B(k, A==1) in a loop but get an error exceeding dimensions. Also thought C = B(A) might work but it just creates a single column matrix with all the colours in question. I need to the matrix to match the dimensions of the pre-existing matrices.
1 件のコメント
Sean de Wolski
2014 年 11 月 12 日
Can you provide sample inputs and the expected results?
Thanks!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!