I am trying to restrict my data from column 3 in the text file (attached) from numbers 11.78 =< x <= 13.25. For some reason, it is including numbers higher than the upper limit set. How would I fix this/ where am I going wrong?
My code is below:
fidi = fopen('virgoclusterrm.txt','rt');Glxc = textscan(fidi, '%s', 'Delimiter','|');frewind(fidi)Glxcs = textscan(fidi, '%s', 'EndOfLine','\r\n');fclose(fidi);dlen = 18*fix(length(Glxc{:})/18); % Set Row Length
Glxcr = reshape(Glxc{:}(1:dlen), 18, [])'; % Reshape & Transpose
LIdx=str2double(Glxcr(:,3))>11.77LIdx=str2double(Glxcr(:,3))<13.25NewGlxc = Glxcs{:}(LIdx,:); % Rows Of New Array
fido = fopen('virgoclusterrmra.txt','wt')fprintf(fido, '%s\n', NewGlxc{:});fclose(fido)
Best Answer