fid=fopen('test1.tsv');ftext=textscan(fid, '%s%s%s%s%s%s%s');chr = ftext(1);ref = ftext{4};alt = ftext{5}; siz_x=size(chr);for i = 1:siz_x(1,1) x_i = chr{i}; idx1 = strmatch('chr1', x_i, 'exact'); sz_idx1 = size(idx1); iendfor j = 1:sz_idx1(1,1) new_idx = idx1(j); ref_i = ref{new_idx}; idx5 = strmatch('A', ref_i, 'exact'); sz_idx5 = size(idx5); jend
MATLAB: How to avoid overwriting of values in 2nd for loop and store all the results
for loopoverwriting
Best Answer