![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1298665/image.png)
How to separate Day side & Night side time stamps and corresponding VTEC data from whole months data ?
7 次查看(过去 30 天)
显示 更早的评论
Hi,
I have whole months satellite data consisting of Timestamp, Latitute, Longitude and Absolute_VTEC data which is combined with day side and night side. I want to plot the whole months data but Day side and Night side separately against Absolute_VTEC. For day side the Im considering form 06:00UT to 18:00UT. At the moment I have ploted a graph using whole month but the day and nignt side is all showing in the graph and I cant draw any conclusions. Any suggestions and help will be highly appriciated ?
Im attaching my plots and monthly data.
plot(Date,Absolute_VTEC);
0 个评论
采纳的回答
Luca Ferro
2023-2-17
编辑:Luca Ferro
2023-2-17
Try this and tell me if it is what you wanted:
dayFilter=and(hour(Date)>=6,hour(Date)<=18); %creates a filter for day hours
nightFilter=~and(hour(Date)>=6,hour(Date)<=18);
day=Date(dayFilter); %applies filter
Absolute_VTEC_day=Absolute_VTEC(dayFilter); %restrict the x axis, the number of elements need to match otherwise you cannot plot
night=Date(nightFilter);
Absolute_VTEC_night=Absolute_VTEC(nightFilter);
figure
plot (day,Absolute_VTEC_day) %plots
figure
plot (night,Absolute_VTEC_night)
The comments are for the day section, but they are still valid for the night. Conceptually they are the same.
Left is the night. right is the day. You nned to format the figures as you prefer. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1298665/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1298665/image.png)
3 个评论
Luca Ferro
2023-2-17
编辑:Luca Ferro
2023-2-17
This is the daily mean (note daily =24 hours )
for dd=1:31
currDayFilter= isbetween(Date,strcat(string(dd),'-Jan-2015 00:00:01'),strcat(string(dd),'-Jan-2015 23:59:59'));
currDay=Absolute_VTEC(currDayFilter);
DayMean(dd)=mean(currDay);
end
plot (DayMean)
if you want different hours just change the purple date string in the inbetween() function. to plot it on overlay use the hold on function as so:
figure
plot(day,Absolute_VTEC_day)
hold on
plot (DayMean)
hold off
figure
...
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!