how to make a timestamp for plotting out of (m:s:ms) ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have an application which gets timevalues ( minutes,seconds,milliseconds) over TCP. This values are generated inside the module which sends data to matlab.
Now i want to convert this values to a timestamp to do some plotting. How can I archive this?
I tried this:
%save Data in Matrix
%make timestamp for plotting data.
timestamp = datetime(0,0,0,0,app.minute,app.second,app.millisecond);
%Save data in matrice for further operations(plotting,saving)
app.x(app.counter,:)=[timestamp,accx,accy,accz,eulx,euly,eulz];
app.counter = app.counter + 1;
But it didn't work.
Thank you very much.
2 件のコメント
Siddharth Bhutiya
2021 年 9 月 21 日
Just based on the information in your question, it seems that you are working with time periods rather than date times. So it seems logical to use duration instead of datetime.
timestamp = duration(0,app.minute,app.second,app.millisecond);
What are the data types of your other values (app.x, accx, accy, eulz, etc.) assuming they are doubles, then you are trying to mix different types in an array which is not supported. When trying to store heterogeneous types you could use table or better timetables since your data seems to be timestamped.
It is difficult to infer a lot just from few lines of code. If you are still stuck then please include some sample data on what each value described in your code looks like and also the exact errors that you are getting. Having more context about the code and data would make it easier for people to provide suggestions.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!