Extract coordinates from a significance matrix

조회 수: 1 (최근 30일)
Eric
Eric 2014년 12월 1일
답변: Azzi Abdelmalek 2014년 12월 1일
Hi everybody,
I've created a matrix with all the significant values from performing ttest (19x19 with 1's and 0's) and I would like to extract the coordinates (like (3,2)) for all the 1 values. And then put them into a matrix like [3,2; 4,2; ...].
Is this possible? And does anyone know how?
Best regards,
Christian

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 12월 1일
a=randi([0 1],19) % Example
[ii,jj]=find(a)
out=[ii jj]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by