Info

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

Store specific values 1 off the diagonal

조회 수: 1 (최근 30일)
Tim Navr
Tim Navr 2016년 4월 5일
마감: Tim Navr 2016년 4월 5일
I have n number of boxes, all along the diagonal and need to place them into different cells. Thank you
So, I have a 6000 by 6000 matrix and the majority of the values are 0. Non zero values are spread in a number of clusters (which are all along the diagonal, although the diagonal itself is 0). I need to check all the values along the diagonal( send a messenger from 1,1 to 6000,6000). At first he will encounter 0, so do nothing. Then, he will come across some values and I need to store x and y coordinates in the first cell or matrix. Then, he will come across 0 and i need to stop the storing process. Next time he encounters a >0 again, start second and third and so on cells. x and y are the row and column numbers. example A= 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0
From the matrix A I need to store the row and column numbers of 2,2 in first cell and 4,4 and 5,5 in the second cell. Except all of my values are around the diagonal with the diagonal itself being 0 Thanks for your help
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 5일
What are x and y? what values do you want to sytore? Please try to make your question clear. You can post a short example a 6x6 Matrix for example, then post an expected result with some explanations.

답변 (0개)

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by