Hi I've got this code that gives me the messages from a variable that are from a mmsi that I want
Msg_mmsi_selected = [];
for i=1:1:L
seq1 = msg_NoMatchAIS1(i);
linia=convertStringsToChars(seq1);
if linia(13)=='A' && linia(15)=='1'
sequencia = ais_to_bit(linia(15:44));
s_mmsi=sequencia(9:38);
mmsi= bin2dec(num2str(s_mmsi));
Msg_mmsi_selected = seq1(mmsi_selected);
end
end
and the error I got is
Index exceeds the number of array elements (1).
Is there any problem in the line code that makes me this error. I thought it was because of not named the variable but I did and do not know why I continue having it.