Combining 2 Matrixes to Run in Large Data Set
Afficher commentaires plus anciens
I have already ran a successful code that starts and stops at a specific time from a very large data set, with each comma separating the time by day. (i.e. the day 1 data runs from 48009 seconds to 66799 seconds, day 2 from 52467 s to 61999, etc.) Shown below:
utcStarts = [48009, 52467, 54128, 54591, 45001, 55587, 56714];
utcEnds = [66799, 61999, 59999, 57999, 45002, 74999, 61499];
I am attempting to run the same code but with two time periods during each day, like this below:
utcStarts = [48009, 52467, 54128, 54591, 45001, 55587, 56714]; utcEnds = [66799, 61999, 59999, 57999, 45002, 74999, 61499];
utcStarts = [730001, 72001, 74001, 80001, 45003, 82001, 68001]; utcEnds = [77659, 80271, 80894, 86181, 74428, 87252, 78116];
i.e. where day 1 will run from 48009 s to 66799 s and again from 73001 to 77659 s, day 2 from 52467 s to 61999 s and again from 72001 s to 80271 s.
Now that I am trying to run the same code for two time periods, I am getting an error which says: "The value assigned to the variable 'utcStarts' and 'utcEnds' might be unused."
What function can I use to combine the two matrixes and run the code for the two different time periods for each day?
Thank you.
1 commentaire
goyanks1989
le 18 Jan 2016
Modifié(e) : Star Strider
le 18 Jan 2016
Réponse acceptée
Plus de réponses (1)
Chad Greene
le 19 Jan 2016
You define utcStarts and utcEnds twice, and the second time overwrites the first time. That's why Matlab says utcStarts goes unused. I have not tried to parse your entire script so depending on how your code is set up, it may be as easy as defining an A and a B start and end time, then concatenate the A and B times:
% NonConvective Hours (A run)
utcStartsA = [48009, 52467, 54128, 54591, 45001, 55587, 56714];
utcEndsA = [66799, 61999, 59999, 57999, 45002, 74999, 61499];
%NonConvective Hours (B run)
utcStartsB = [730001, 72001, 74001, 80001, 45003, 82001, 68001];
utcEndsB = [77659, 80271, 80894, 86181, 74428, 87252, 78116];
% Concatenate:
utcStarts = [utcStartsA utcStartsB];
utcEnds = [utcEndsA utcEndsB];
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!