Replace NaN's in a table - I need some help
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello all, I have a table namely T2,
it has 12 columns. in all of these columns I have some NaN values. I would like to replace NaNs in the 1 to 7 column. the problem is I want to replace these NaNs by non-NaN values in each column (the value in each row is stable).
for example ( for two columns):
NaN NaN NaN
NaN RAD NaN
Behezad RAD MORD
NaN NaN MORD
I want:
Behezad RAD MORD
Behezad RAD MORD
Behezad RAD MORD
Behezad RAD MORD
for each column. it is important that every column has it's own value. I don't want to have any change in column 8 to 12 NaNs
thank you, I wait for your kindly answers.
best regards
7 Kommentare
Antworten (2)
Ridwan Alam
am 19 Dez. 2019
Bearbeitet: Ridwan Alam
am 19 Dez. 2019
T2.col1(ismissing(T2.col1)) = "Behezad";
T2.col2(ismissing(T2.col2)) = "RAD";
T2.col3(ismissing(T2.col3)) = "MORD";
2 Kommentare
Ridwan Alam
am 19 Dez. 2019
Sure, Behzad. Please share what you've tried to automate this. And if there is any specific error or question, I would be glad to help. But, I am not willing to write your whole code for you.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!