Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
i need to compare each value in cell with different rows for average filling method kindly guide me good technique
조회 수: 1 (최근 30일)
이전 댓글 표시
2 5 3 x 5,
3 4 5 6 7 ,
5 6 7 x 9,
2 5 3 1 1
the code must run like this
i will search for x in each row if found then will compare its corresponding row value.
example 2 5 3 x 5 ....x found here now comparison starts with other rows
2 5 3 x 5 -3 4 5 6 7....no match found so inc=0, 2 5 3 x 5 - 3 4 5 6 7, 2 5 3 x 5-2 5 3 1 1---match found (2,2,5,5,3,3) si inc=3 most matched row
댓글 수: 5
Azzi Abdelmalek
2016년 8월 23일
You are using expression that are not clear: increment must take place! Edit your original question, make it clear by psting the expected result
답변 (1개)
Andrei Bobrov
2016년 8월 23일
a = [2 5 3 nan 5
3 4 5 6 7
5 6 7 8 9
2 5 3 1 1];
t = ~isnan(a);
[m,n] = size(a);
[y,x] = ndgrid(1:m,1:n);
f = scatteredInterpolant(x(t),y(t),a(t));
out = f(x,y);
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!