Borrar filtros
Borrar filtros


La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How can I loop this

4 visualizaciones (últimos 30 días)
flashpode el 1 de Feb. de 2022
Cerrada: Cris LaPierre el 1 de Feb. de 2022
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 comentarios
Benjamin Thompson
Benjamin Thompson el 1 de Feb. de 2022
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 el 1 de Feb. de 2022
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);
if linia(13)=='A' && linia(15)=='1'
sequencia = ais_to_bit(linia(15:44));
longitud = bin2dec(num2str(s_longitud))/600000; % en graus
lon1 = [lon1, longitud];
latitud = bin2dec(num2str(s_latitud))/600000; % en graus
lat1 = [lat1, latitud];
hope it helps

Respuestas (0)

La pregunta está cerrada.


Community Treasure Hunt

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

Start Hunting!

Translated by