calculate data based on previous values and replace it at negative and zeros values
2 views (last 30 days)
Show older comments
there is different data in the column in excel (REACTIVE_Y_PH), which has some negative and zeros values also, these values should be replaced by calculating the average of previous data and replace them.
5 Comments
Answers (1)
KSSV
on 4 Jul 2018
[num,txt,raw] = xlsread('sample.xls') ;
data = cell2mat(cellfun(@str2num,txt(:,2),'un',0)) ;
%%fill negative and zeros
idx = data<=0 ;
data(idx) = NaN ;
data = fillmissing(data,'previous') ;
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!