weighted average for an array

조회 수: 3 (최근 30일)
Anisha Varughese
Anisha Varughese 2019년 7월 29일
답변: Anisha Varughese 2019년 7월 29일
Hey
Can someone please tell me how to use weighted average for an array
  댓글 수: 5
Adam Danz
Adam Danz 2019년 7월 29일
There isn't enough information in your question to form a useful answer. Weighted averages can be used in many ways. From what we currently know, you have a weighted average and you're asking how to use it or you're asking for code that uses weighted averages. The question is unclear.
dpb
dpb 2019년 7월 29일
sum(weights.*array)
is ok if sum(weights) == 1; the general rule is
sum(weights.*array)/sum(weights)

댓글을 달려면 로그인하십시오.

답변 (1개)

Anisha Varughese
Anisha Varughese 2019년 7월 29일
Thank you.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by