フィルターのクリア

Trying to extract outliers from array

2 ビュー (過去 30 日間)
FIONA HOTCHKISS
FIONA HOTCHKISS 2021 年 12 月 7 日
コメント済み: FIONA HOTCHKISS 2021 年 12 月 7 日
%Point Barrow, Alaska
PB=readtable('daily_flask_co2_ptb.csv');
%create time and CO2 variable
PBdailyt=PB(:,4);
PBdailyCO2=PB(:,7);
PB.t=table2array(PBdailyt);
PB.CO2=table2array(PBdailyCO2);
%extract outliers by finding and replacing with NaN
PB.CO2x=find(PB.CO2 >=450 | PB.CO2 <=300);
for i=1:length(PB.CO2);
PB.CO2x(PB.CO2(i))=NaN;
end
"To assign to or create a variable in a table, the number of rows must match the height of the table."
I used the table2array but the above message is still popping up when I try to find the outliers of the data. I also noticed that all expect the PB.CO2 & PB.CO2x variables are showing up in my workspace. If their is another way to find and extract the outliers that would be helpful.

採用された回答

KSSV
KSSV 2021 年 12 月 7 日
編集済み: KSSV 2021 年 12 月 7 日
%Point Barrow, Alaska
PB=readtable('daily_flask_co2_ptb.csv');
%extract outliers by finding and replacing with NaN
idx = PB.CO2 >=450 | PB.CO2 <=300 ; % <-- you need to think on this condition
PB.Co2(idx) = NaN ;
  1 件のコメント
FIONA HOTCHKISS
FIONA HOTCHKISS 2021 年 12 月 7 日
Thank you! That was very helpful

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by