Replacing NaN with last real value
2 次查看(过去 30 天)
显示 更早的评论
Hi folks, I have hundreds of excel files in .csv format that I have to "clean" getting rid of all teh NaN values and replacin them by the last value.
I have tryied using the repnan function but somethinf seems wrong.
Here is what i did
xlsread ECUSIMTEST0000-000-01.csv
for k=1:size(ans,2)
ans(:,k) = repnan(ans(:,k),"previous")
end
Where ans is the double imported from excel. I am a beginner in matlab so no step is trivial to me.
Thanks !!!
0 个评论
采纳的回答
Star Strider
2020-1-15
3 个评论
Asliddin Komilov
2020-1-17
I have set of 25 variables (matrices), can I have repliced all zero value to NAN in all of the at once, without doing it for each of them separately?
thanks
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!