Hi, my for loop keeps repeating the same third value for the maximum index value. Can anyone please check it for me? the full code is:
for k = 1:3 Driftt = sprintf('Drift%d.out', k); Reactt = sprintf('React%d.out', k); matDrift = importdata(fullfile(Driftt)); matReact = importdata(fullfile(Reactt)); x= matDrift(:,2); y= -sum(matReact(:,2:11),2); plot(x,y) hold on; %
sort = zeros(N,2); for i=1:N [valy,idx] = max(y); sort(i,:) = [x(idx,1),valy]; hold on; endend
Best Answer