Index exceeds matrix dimensions. ?
Show older comments
Hear is my code
%%Get Full Image Data
% ENVI Import Cube and Register images
datafile = '0604img-17_FlatField';
hdrfile = '0604img-17_FlatField.hdr';
%%Read ENVI Files
[im, hdr] = enviread([old '\' datafile],[old '\' hdrfile]);
img = imrotate(im,90, 'nearest');
figure; imshow(img(:,:,124));
%d = reshape(textread('listplot.txt', '%s'),1,12)';
%list of coordinates as x and y
load('listp.txt');
for i = 1:12
% pixval(i) = i+ img(d,:);
pixval(i) = i+ img(VarName1,VarName2,:);
end
It says it exceeds matrix dimentions. Some info: the "load (listp.txt) " outputs 2 list VarName1 12x1 double and VarName2 12x1 double. What i was doing before to call the information was to
pixval = img(74,100,:)
this gave me a 1x1x361 matrix with all the data of that point. What I want to do is store the multiple points without having to create a variable for each (I.E. pixval1, pixval2 ext..)
Accepted Answer
More Answers (0)
Categories
Find more on Display Point Clouds in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!