Delete first row matrix and records new value
5 次查看(过去 30 天)
显示 更早的评论
Hey! I'm going to record data continuously, and acquire 1000samples/sec for 8 different channels (from a DAQ board). After 30 seconds I'll have a 30000x8 matriz and I'll need to average each column except for the first one. After averaging it I'll need to save that value, delete the first second of this acquired data (which means the first 1000 lines from the matrix) and move the whole matrix 1000 lines up, so I can record the next second worth of data (the next 1000 lines), and repeat this while I'm recording live data, for an undefined period of time.
Anyone know how I can do this? Mainly, delete the first 1000 rows, move the matrix up to start at line 1 again and record new data in the last 1000 lines that just became empty by moving the matrix up.
I'm very new to matlab and would really appreciate any kind of help.
0 个评论
回答(2 个)
Sulaymon Eshkabilov
2021-7-7
Have you read this documentation for DAQ tools and fcns of MATLAB:
Why not to collect all data for whole 30 sec or whatever time length, and then perform averaging or any necessary data processing. If this data processing has to be continuous for control purposes, then it is necessary.
Soniya Jain
2021-7-7
- To find mean of matrix, you can refer Matlab documentation: https://in.mathworks.com/help/matlab/ref/mean.html
- What do you mean by moving the matrix up? If you want to delete the 1st 1000 rows, you can overwrite it. And you can use loop to record new data every time
- To learn more about Matlab, you can refer Matlab Onramp Course.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Acquisition Toolbox Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!