I have a 2D matrix. Let's say A=80×100; I need a way to visit each cell in this matix only once. Moreover my problem is a little more involved than that. Not only do I want to visit each cell only once but the user also defines a window of certain size. Let's say WINDOW=3×3. Then let's say I randomly choose a location on A that corresponds to indecies [2,3]. Then this is considered a central location and in my algorithm I will also consider points around this central location as specified by the window. Hence in this example I will also consider points at indecies [1,3],[3,3],[1,2],[2,2],[3,2],[1,4],[2,4],[3,4]. So in the next round when I am trying to figure out which cell in A to visit, I will not consider these 9 points in my random draw. Any suggestions? Thanks!
MATLAB: Not sure how to approach this
random draw
Related Question
- How to segment data using overlapping window
- Error using reshape To RESHAPE the number of elements must not change.
- Cell comparison with other cells in different rows
- I need to distribute n number of samples randomly on a given grid surface by monte carlo would you help me please.
- How to replace consecutive 4 elements of an array with the largest element among every 4 consecutive element
- Can I speed up an ismember operation
- Possible to vectorize matrix split and stack
Best Answer