How to exclude values in column A based on quality flags in column B
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Claire
el 16 de Sept. de 2020
Respondida: Sai Sri Pathuri
el 22 de Sept. de 2020
I have a file with multiple columns, column A has dates, column B has values, and column C is marked with a 0 or 1 as a quality flag (1 = unacceptable quality, 0 = acceptable quality). I need to average the data from column B based on sample date in column A, and change all the unacceptable quality data as a NaNs. I am not sure how to change change those column B values into NaNs using the quality flags of column C. Sorry if this is confusing, still new at this!
0 comentarios
Respuesta aceptada
Sai Sri Pathuri
el 22 de Sept. de 2020
Following code may help.
You can use readtable/readmatrix to read the file into matlab. Consider X be the matrix containing A,B,C as first,second and third columns respectively. You may set the values of B to NaN using column C values as:
X(X(:,3)==0,2) = nan;
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!