convert array that has NAN to 0
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sri satya ravi
am 12 Aug. 2022
Kommentiert: sri satya ravi
am 12 Aug. 2022
I am having an array of length 1669965*1 double. There are some NAN's in it which are intermixed with the required data.
I am trying the convert NAN's to 0 without changing the length of the array.
Charge_P = Charge_P(isnan(Charge_P))=0;
I am getting an error saying i have to use '==' but if i use it it is modifying the length of my array.
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 12 Aug. 2022
You can't have two assignment operators (the equals sign) in a single command. I think you just want this
Charge_P(isnan(Charge_P))=0;
Charge_P = fillmissing(Charge_P,'constant',0)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!