interpolating the NaNs in Cell array - 180x1

2 visualizzazioni (ultimi 30 giorni)
ANIL TUNCAY
ANIL TUNCAY il 14 Ago 2020
Commentato: ANIL TUNCAY il 14 Ago 2020
I have a Cell vector - I have tried everything i am still getting an error, i am using matlab 2018b version, i am looking for the answer how to interpolate the NaNs in my cell array

Risposte (2)

KSSV
KSSV il 14 Ago 2020
Let (x,y) be your data where x and y are n*1 arrays each. Say you have NaN's in y and you want to fill them.
idx = isnan(y) ;
y(idx) = interp1(x(~idx),y(~idx),x(idx)) ;
  3 Commenti
ANIL TUNCAY
ANIL TUNCAY il 14 Ago 2020
even I used ismissing but then it's not displaying the NaN it's showing whole data 0s meaning like there is no missing values
ANIL TUNCAY
ANIL TUNCAY il 14 Ago 2020
thank you for the help in advance by the way

Accedi per commentare.


Bruno Luong
Bruno Luong il 14 Ago 2020
y = fillmissing(y,'linear')
  2 Commenti
ANIL TUNCAY
ANIL TUNCAY il 14 Ago 2020
i have tried this too but it is not changing with this - after doing this with different methods spline, previous etc. my data is still with the NaNs
ANIL TUNCAY
ANIL TUNCAY il 14 Ago 2020
thank you for the help in advance by the way

Accedi per commentare.

Categorie

Scopri di più su Numeric Types in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by