NaN values in timetable - how to calculate Nash–Sutcliffe model efficiency coefficient?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Elizabeth Lees
el 24 de Mzo. de 2021
Editada: Elizabeth Lees
el 27 de Mzo. de 2021
I would like the calculate the Nash–Sutcliffe model efficiency coefficient between various variables in a dataset. However a number of rows do contain missing data so I would like to exclue them from the calculate too. Is there a function that will allow this in matlab?
1 comentario
Jan
el 24 de Mzo. de 2021
So the actual problem is how to remove rows with missing data? Then please post an example, which shows, how "missing" data are represented.
Respuesta aceptada
Star Strider
el 24 de Mzo. de 2021
If the ‘missing’ data are NaN entries, this works:
data = rand(10,3); % Create Array
data(randi(30,1,5)) = NaN; % Create Missing Data
rowidx = ~any(isnan(data),2); % Rows Without ‘NaN’ Entries
data_new = data(rowidx,:); % Matrix With No ‘NaN’ Values
If the missing entries are in a cell array with empty cells, this works:
data = num2cell(rand(10,3)); % Create Cell Array
data(randi(30,1,5)) = {[]}; % Create Missing Data
rowidx = ~any(cellfun(@isempty,data),2); % Rows Without Empty Cells
data_new = data(rowidx,:); % Matrix With No Empty Cells
.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!