How to select a data set from columns having using criteria?
古いコメントを表示
I have 5 columns in the file mycolumns. They all have the same dimension. I would want to reduce the number of rows of all the columns by same amount by selecting the row that first meet the condition where the elements of columns "acc<10" and "C<20". I am interested in the first row meeting the criteria to the end of rows of each column. Again I would want to know the time the first row met the criteria and then subtract for the initial time,thus, time(1,1) to obtain the number of minutes it took for the criteria to be met. Thanks for you support.
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2015 年 6 月 27 日
編集済み: Azzi Abdelmalek
2015 年 6 月 27 日
v=[time A B C acc ];
idx=v(:,5)<10&v(:,4)<20;
out=v(idx,:)
Time_criteria=v(find(idx,1),1)
2 件のコメント
AbelM Kusemererwa
2015 年 6 月 27 日
編集済み: AbelM Kusemererwa
2015 年 6 月 28 日
Azzi Abdelmalek
2015 年 6 月 28 日
編集済み: Azzi Abdelmalek
2015 年 6 月 28 日
v=[time A B C acc ];
idx=find(v(:,5)<10&v(:,4)<20,1);
out=v(idx:end,:)
out(:,1)=out(idx,1)-v(idx,1)
カテゴリ
ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
