I created a for loop for a 5×5 matrix (it is a struct with data in it). But there are some values of the matrix I don't want to calculate. For example, I don't want to calculate cell (1,4). I also don't want to calculate the cell (3,4), (4,4),…
if ~((i_testen == 4) & (welke_pp == 1)) | ((i_testen == 4) & (welke_pp == 3)) | ((i_testen == 4) & (welke_pp == 4)) | ((i_testen == 4) & (welke_pp == 5)) %i_testen stands for the measurementnumber. welke_pp stand for the subjectnumber.
RASI = data_sts(welke_pp,i_testen).VideoSignals(:, strcmp('RASI', data_sts(welke_pp,i_testen).VideoSignals_headers)); %extract data
XY(2,1) = max(RASI) %maximum of RASI
XY(1,1) = 0; %mimimum is set to zero
Begin_Eind_sts.Begin(i_testen) = abs(XY(2,1)); %store data
Begin_Eind_sts.Eind(i_testen) = abs(XY(1,1));close all %close all opened figures
else continue %continue with the previous for-loop
end
The problem is that the program runs perfectly, and even when the values for i_testen = 4 and welke_pp = 1, the program goes to 'else' and continues the for loop. But when the next values for the if-expression comes up (being i_testen = 4 and welke_pp = 3), the program doens't jump to 'else'.
Best Answer