I want to solve this problem please

I want to from each element if metric f select the min value from metric p and get average of them like this i want from first element of metric f until end.
example
first element of f finding the Minimum element in p and obtain the average
Again second element in f finding the Minimum element in p and obtain the average
again third element in f finding the Minimum element in p and obtain the average......
like this until end
Thank in advance

댓글 수: 4

Torsten
Torsten 2016년 8월 19일
The description of your problem is not comprehensible (at least for me).
Best wishes
Torsten.
abduall hassn
abduall hassn 2016년 8월 19일
example matrix f we have around 44 vector and matrix p we have 9 vector my target is
each vector in matrix f find the Minimum vector in matrix p after that obtain the average
example vetcor 3 in matrix f 11.3417693420768 is near to the vector 3 in matrix p after finding we obtain the average of them
same vector 8 in matrix f is 12.1636399795748 is very near to vector 1 in matrix p after that obtain the average of them
like this first vector of matrix f to and
JA
JA 2016년 8월 19일
After this comment, i have edited my answer, check that. I have not personally checked the answer. But you should get the concept
James Tursa
James Tursa 2016년 11월 3일
I have edited your title and removed all of those exclamation points. In the future please do not do this as it is annoying to readers.

답변 (1개)

JA
JA 2016년 8월 19일
편집: JA 2016년 8월 19일

0 개 추천

Your desciption of the problem is not understandable, but from what i understand you want to take 1 element of f and find the closest of this number in p and take the average
f = [ your data];
p = [ your data];
favg = zeros(1,length(f));
for i = 1: length(f)
[c index] = min(abs(p-f(i)))
closestvalue = p(index)
favg(i) = (f(i)+closestvalue )/2
end

댓글 수: 1

JA
JA 2016년 8월 19일
Your minimum from vector p was difficult to understand. but what my solution does is. when u take 1st element from vector f. it'll find the closest value to this in vector p. then finds an average of the 1st element of f vector and it's closest value, saves it in favg

이 질문은 마감되었습니다.

제품

태그

질문:

2016년 8월 19일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by