필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Create a new matrix with values that appear in two separate matrix

조회 수: 1 (최근 30일)
Isaiah Stefan Engle
Isaiah Stefan Engle 2017년 4월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
I am new to Matlab and thus this could be a very trivial question and I appreciate those who take the time to help. I have a 618x2 matrix that has values in the first column and then the index of the value (circles on an image for this case). For example
46.9810, 1
0, 2
0, 3
0, 4
43.1429, 5
0, 6
0, 7...
This matrix is called 'Test2'
I have another matrix that is a 1x58 matrix (called overlapindex) The values in this matrix corresponds to the index in the 'Test2' matrix for example: 1, 3, 5, 7, 35, 37, 44, 49,....
I need a new matrix (let's call it NEW) that checks if the value in overlapindex has a nonzero correlating value in the 'Test2' matrix. For example, this NEW matrix would include [43.1429, 5] because the index is in both 'Test2' and also in 'overlapindex' and the corresponding value in 'Test2' is nonzero.
so essentially this 'NEW' matrix would look like...
46.9810, 1
43.1429, 5
and so on until all the indexes are checked and the 'NEW' matrix is made.
I just need to make sure that the index in 'overlapindex' corresponds to an actual non zero value in the 'Test2' matrix.
Please help and thank you in advance!

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by