Combining 2 Matrixes to Run in Large Data Set
이전 댓글 표시
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
goyanks1989
2016년 1월 18일
편집: Star Strider
2016년 1월 18일
채택된 답변
추가 답변 (1개)
Chad Greene
2016년 1월 19일
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];
카테고리
도움말 센터 및 File Exchange에서 Interpolation of 2-D Selections in 3-D Grids에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!