Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I loop this

조회 수: 1 (최근 30일)
flashpode
flashpode 2022년 2월 1일
마감: Cris LaPierre 2022년 2월 1일
I want to create a loop for when for all the messages that are in the variable of duration are within one rank that is going from one number to another. Let me explain with an example
my variable of duration goes from 00:00:00 to 23:59:59 I want to create a loop that runs my code when the time of the messages are first from time 00:00:00 to 00:10:00. Then from 00:10:00 to 00:20:00 (10 mins each time) till it reaches from 23:50:00 to 23:59:59
  댓글 수: 2
Benjamin Thompson
Benjamin Thompson 2022년 2월 1일
You want to call a function every 10 minutes? Or are you reading in a file containing message data with time stamps and after every 10 minutes of time in the data you want to call a function? If you are processing messages from a data file please post a sample of the file.
flashpode
flashpode 2022년 2월 1일
I got a variable of data that is associated to the variable of time I got by the position. Its like: message 1 of variable X has his time in the position one of the variable of time. I want to run my code for all the messages that are from minute 00 to minute 10 then from minute 10 to minute 20 and this till the end.
I post the variable of time, the variable of data for the loop and the loop. What I need is to create this restriction.
lat1 = [];
lon1 = [];
L = size(msg_NoMatchAIS1,1);
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));
if
s_longitud=sequencia(62:89);
longitud = bin2dec(num2str(s_longitud))/600000; % en graus
lon1 = [lon1, longitud];
s_latitud=sequencia(90:116);
latitud = bin2dec(num2str(s_latitud))/600000; % en graus
lat1 = [lat1, latitud];
end
end
hope it helps

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by