Filter löschen
Filter löschen

Trying to extract outliers from array

2 Ansichten (letzte 30 Tage)
FIONA HOTCHKISS
FIONA HOTCHKISS am 7 Dez. 2021
Kommentiert: FIONA HOTCHKISS am 7 Dez. 2021
%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.

Akzeptierte Antwort

KSSV
KSSV am 7 Dez. 2021
Bearbeitet: KSSV am 7 Dez. 2021
%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 ;

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by