How add condition statement in an array? - MATLAB -
i'm working on mapping linking 2 coordinates , database huge. hence display part of work on had done. question: add start , stop number together. if more 1,000,000 distance 100. else distance remain unchanged. store in single array. really appreciate respond. :) coding clear; n = xlsread('regionall.xlsx',2); m = xlsread('regionall.xlsx',1); % list of coordinates distance = distance(m(start,3:4), m(to,3:4)); % coordinates distancekm = deg2km(distance); sum = n(:,1)+n(:,2); %problem below l = 1:625 sum = n(l,1)+n(l,2); if (sum>1000000) = 100; else = distancekm(l,1); end; end excel data sample in variable n start stop distance 13054 13055 0.017749628 13055 13001 0.152363674 560601 13043 0.063200318 560601 13042 0.036090789 560601 13041 0.021083981 560601 13037 0.04975146 560604 13031 0.047614849 560604 13030 0.051513765 560604 13029 0.076687991 560604 560605 0.060676069 ...