You hae v_indices=indices inside your for r loop, so nothing assigned to v_indices is kept for the next iteration of r. You do not assign to indices within the loop, so running multiple times is not making iterative changes to indices.
Therefore, your final result in v_indices is going to be the same as if you had only done one (the last) iteration of the for r loop, so you might as well not have a for r loop there.
6 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111450
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111450
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111670
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111670
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111760
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111760
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111790
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111790
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111915
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111915
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111945
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/636960-a-fast-cell-array-generation#comment_1111945
Sign in to comment.