Unrecognized function or variable 'movcorr'

조회 수: 9 (최근 30일)
Franziska Höppe
Franziska Höppe 2021년 3월 27일
답변: Star Strider 2021년 3월 27일
Hello :-)
I would like to estimate a 5-year rolling correlation, so I use an 1260window (for 5-year trading days)
B is an matrix (k,m) and C is a vector (1,m)
I would like to get an (k,m) vector of the correlations, but if I code
testcor=zeros(k,m);
for i=1:k
testcor(i,m)=movcorr(B(i,:), C(1,:), 1260);
end
I get: Undefined function 'movcorr' for input arguments of type 'double'.
If I code:
movcorr(B(1,:), C(1,:), 1260);
I get: Unrecognized function or variable 'movcorr'.
What can I do?
Thank you in advance!

답변 (1개)

Star Strider
Star Strider 2021년 3월 27일
Download movcorr from the File Exchange.
Put it somewhere in your MATLAB user path. Do not put it anywhere else. See What Is the MATLAB Search Path? for details, if you are not already acquainted with it.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by