I run the following code:
for ii = length(pks4) %repeat the following process as many times as the pks4 points are
for k2 = (pks4(ii):xfb(end)); % for all k2 that belong between pks4 and the end of index
first2(ii) = k2(k2>xfb2); %find all k2 such that k2 is greater than xfb2
if ~isempty(first2) first2 = first2(1); % store the first number (first2) which is greater than xfb2
else disp('No value of k2 is greater than xfb2.') end distS(ii) = size(pks4(ii):first2(ii)); % distance between each pks4 and first2 points
mean_distS = mean(numPointsS(ii)); % mean distS
Send = locs_SwaveB*mean_distS; %location of S point
endend
but in the end I get neither an error message nor any results. What's wrong with this code? And why Matlab doesn't give any error messages?
Thanks in advance for any help.
Best Answer