How can I fix this code?
[xb, yb] = getpts; %click on the bases you would like to add
new_coords = [yb xb]
imgcoordsRC = [imgcoordsRC(:,1:2); new_coords];
idx2 = sub2ind([1520 2704],floor(imgcoordsRC(:,1)),floor(imgcoordsRC(:,2)));
imgcoords = zeros([1520 2704]);
imgcoords(idx2) = 1;
imshow(coordsImage)
Index exceeds the number of array elements. Index must not exceed 1.[xb, yb] = getpts; %click on the bases you would like to add
new_coords = [yb xb]
imgcoordsRC = [imgcoordsRC(:,1:2); new_coords];
idx2 = sub2ind([1520 2704],floor(imgcoordsRC(:,1)),floor(imgcoordsRC(:,2)));
imgcoords = zeros([1520 2704]);
imgcoords(idx2) = 1;
imshow(coordsImage)
Index exceeds the number of array elements. Index must not exceed 1. [xb, yb] = getpts; %click on the bases you would like to add
new_coords = [yb xb]
imgcoordsRC = [imgcoordsRC(:,1:2); new_coords];
idx2 = sub2ind([1520 2704],floor(imgcoordsRC(:,1)),floor(imgcoordsRC(:,2)));
imgcoords = zeros([1520 2704]);
imgcoords(idx2) = 1;
imshow(coordsImage)
Index exceeds the number of array elements. Index must not exceed 1. help, please MATLAB Answers — New Questions