Info

This question is closed. Reopen it to edit or answer.

Store specific values 1 off the diagonal

1 view (last 30 days)
Tim Navr
Tim Navr on 5 Apr 2016
Closed: Tim Navr on 5 Apr 2016
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 Comment
Azzi Abdelmalek
Azzi Abdelmalek on 5 Apr 2016
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.

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!