フィルターのクリア

Delete Columns from a table where the 1st element in the column is a negative number?

2 ビュー (過去 30 日間)
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?

採用された回答

Guillaume
Guillaume 2019 年 4 月 4 日
Your screenshot does not appear to be that of a matlab table. It looks like you have a matrix, so:
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.

その他の回答 (1 件)

CHRISTOPHER MILLAR
CHRISTOPHER MILLAR 2019 年 4 月 4 日
Thanks Guillaume
I am very new to Matlab, still trying to get my head around tables and matricies

カテゴリ

Help Center および File ExchangeGenerate Report についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by