Insert the date to a missing values of series of time add NaN to the result of the sensor that measures wind velocity, wind direction, pressure, global radiation and % of humidity
1 次查看(过去 30 天)
显示 更早的评论
Hi, thanks a lot for help me always, you are awesome, I am using right know the matlab R2020a
now i have a problem that seems very easy but i read all the answer for this question and anyone have the same problem that me or the question is no properly answer, so... here i go.
i have a series of data with this results, i attach the excel but it look like that:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/293752/image.jpeg)
this NaN i insert manually, and you can notice from the image that the missing values are random, the sensor continue giving data without any problem, and continue to the next date like for example jump from 3:50 to 4:20 like nothing happens, actually i have to add the date manually too.
i have looked at similar questions in here, but they all seem to be a bit different
I know this is very simple but i tried with a few programs and no one works, this same problem occur for all the next years (eight years) so do it manually take me a lot of time.
Thanks a lot for you time
Best !!!!!!!!!!
0 个评论
采纳的回答
Mohammad Sami
2020-5-18
If I understand your question correctly, your data has missing timestamps. You want to add these back.
I suggest you import your data as timetable and then use retime function, with the interval of 10 minutes.
TT = retime(TT,'regular','fillwithmissing','TimeStep',minutes(10));
6 个评论
Mohammad Sami
2020-5-18
Ok. Can you check what is the variable name you get for the minutes column after you read it on your computer. On my computer I was getting Var2. You can execute the first two lines and then open the variable for inspection.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!