Delete Columns from a table where the 1st element in the column is a negative number?
4 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/212006/image.png)
I have a number of tables that contain sensor data from 8 channels and the 1st row in the table is the time this data was sampled at.
I want to delete all the data from the columns where the 1st element in the column is a negative number
How do I do this?
0 个评论
采纳的回答
Guillaume
2019-4-4
yourmatrix(:, yourmatrix(1, :) < 0) = []; %delete all rows of the columns whose 1st row is negative.
Your data would probably be better stored in a matlab table or even better a timetable. For that you'd have to transpose your matrix so that the time is in column format.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Generate Report 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!