How can I change timetable to timeseries?
    30 次查看(过去 30 天)
  
       显示 更早的评论
    
Hello everyone,
I am trying to convert a timetable (DD:MM:YYYY HH::MM:SS) into a time series so that I can run it in Simulink but have trouble doing so. Is anyone able to help me out?

0 个评论
采纳的回答
  Star Strider
      
      
 2025-5-1
        According to the timeseries documentation, it wants the data values as the first argument, and the time values as the second argument.  
From the documentation: 
ts = timeseries(datavals,timevals)                        specifies the sample times for the series. The resulting object sorts the data by time.
.
4 个评论
更多回答(1 个)
  Walter Roberson
      
      
 2025-5-1
        timeseries() does not accept duration or datetime times. 
"Sample times, specified as a numeric scalar or vector, or a cell array of date character vectors. Valid date character vectors can have the following forms:"
You can use
ts = timeseries(Tsec{:,:}, datestr(Tsec.Properties.RowTimes));
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Time Series Events 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

