filling missing values with NA
Mostrar comentarios más antiguos
Hey all,
I am trying to compare model output to observations, but some observations are missing, and I need to fill them with NAs in order to make plots.
My observations are in a struct. See the attached photos for a visual of what I'm working with.


I have tried a couple ways to fill missing values with NAs, but nothing has been successful so far - this is what I have tried:
for ii = 1:length(runs_wanted)
for jj = 1:length(results(ii).point)
missing = ismissing(observations(ii).point(jj).Hs_select)
observations(ii).point(jj).Hs_select(missing) = NaN
end
end
and
for ii = 1:length(runs_wanted)
for jj = 1:length(results(ii).point)
if observations(ii).point(jj).Hs_select == ' '
observations(ii).point(jj).Hs_select == Nan
end
end
end
If anyone could help me figure this out I'd really appreciate it!
Thanks all,
Rae
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!