a=trainclass{1,1};//dimension of trainclass is (200x103double)[r c dim]=size(a);[x,y]=ndgrid(1:r,1:2:c);ind=sub2ind(size(a),x,y);indshift=sub2ind(size(a),x,y+1); //when i run this script, i got out of range error in this line.
MATLAB: Sub2ind out of range error
out of range error
Related Question
- Updating values in array based on index vector
- Creating a matrix from two sets of data
- Error using ==> sub2ind at 58 Out of range subscript.
- How to reshape 1-D to 2-D matrix with missing data
- How to assign values to a matrix from index array
- How to get all entries of the lower triangular (simplex) of a tensor with arbitrary dimension
- Find is working in strange way
Best Answer