필터 지우기
필터 지우기

How can i write this in Matlab?

조회 수: 1 (최근 30일)
Jane Smith
Jane Smith 2020년 3월 28일
댓글: Walter Roberson 2020년 3월 28일
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 3월 28일
The summation can be split to and each of those Σ can be translated into a sum() call.
With a small bit of cleverness you can also replace two of the sums with var() calls.

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

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 3월 28일
편집: Ameer Hamza 2020년 3월 28일
If x and y are 1D vectors then try something like this.
x = rand(100, 1);
y = rand(100, 1);
x_bar = mean(x);
y_bar = mean(y);
b_hat = sum(x-x_bar)*sum(y-y_bar)/sum((x-x_bar).^2);

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by