filling missing value using linear interpolate in 2D
조회 수: 7 (최근 30일)
이전 댓글 표시
From the attached file, i used FUni=fillingmissing2(filename,''linear'') to fill the missing numbers from my data, is this the correct code but i am not quite sure about it, i just need confirmation before i go further
답변 (1개)
Star Strider
2023년 10월 17일
This works —
T1 = readtable('GreenhouseData.xlsx', 'VariableNamingRule','preserve')
VN = T1.Properties.VariableNames;
T1(:,[2 3]) = fillmissing(T1(:,[2 3]),'constant','NaN');
T2 = fillmissing(varfun(@str2double,T1, 'InputVariables',[2 3]), 'linear');
T2 = addvars(T2, T1{:,1}, 'Before',1);
T2.Properties.VariableNames = VN
figure
plot(T2.Time, T2{:,[2 3]})
grid
xlabel(VN{1})
ylabel('Value')
legend(VN{[2 3]}, 'Location','NW')
It should be easier to use varfun for these conversions. It should not require creating a separate table.
.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
