problem with using the function movcorr to compute moving error

조회 수: 2 (최근 30일)
Emmanuel
Emmanuel 2024년 7월 10일
댓글: Emmanuel 2024년 7월 18일
I'm trying to compute moving correlation using the line of code below
rsn_zoscoast_BCC_CSM2_MR = movcorr(south_zoscoast_BCC_CSM2_MR, north_zoscoast_BCC_CSM2_MR, 15,'endpoints', 'discard');
I amtrying to remove the edge effect by setting the 'endpoints', 'discard'
I got the following error message:
VALID_MISS), errId,
ERR_MSG_MISS_INVALID);
Error in movcorr (line 108)
= parseInputs(x, y, k, varargin);
Error in Ana_corr_moving (line 32)
rsn_zoscoast_ACCESS_CM =
movcorr(south_zoscoast_ACCESS_CM2,
north_zoscoast_ACCESS_CM2,
15,'endpoints', 'discard');
  댓글 수: 1
Steven Lord
Steven Lord 2024년 7월 10일
That's not the full and exact text of the error message. Please show us all the text displayed in red in the Command Window (and if there are any warning messages displayed in orange, please show us those too.) The exact text may be useful and/or necessary to determine what's going on and how to avoid the warning and/or error.

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

답변 (1개)

Garmit Pant
Garmit Pant 2024년 7월 12일
Hello Emmanuel
From what I gather, you are using the “movcorr” function, present in the File Exchange, to calculate the Moving Pearson product-moment correlation coefficient.
The error that you have encountered is due to a mismatch in the expected input arguments and the ones passed by you. The function “movcorr” has 4 input arguments, ‘x’, ‘y’, ‘k’ and ‘missing’, out of which the last one is optional. All other arguments are name-value pairs.
Thus, when running the following line to call the function:
rsn_zoscoast_BCC_CSM2_MR = movcorr(south_zoscoast_BCC_CSM2_MR, north_zoscoast_BCC_CSM2_MR, 15,'endpoints', 'discard');
The error is produced since the spelling of ‘endpoints’ is incorrect. The correct name-value pair argument is ‘Endpoints’. Due to the incorrect name-value pair, the function recognizes it as the value for the input argument ‘missing’.
Kindly use the following code snippet to eliminate the error:
rsn_zoscoast_BCC_CSM2_MR = movcorr(south_zoscoast_BCC_CSM2_MR, north_zoscoast_BCC_CSM2_MR, 15, ...
'Endpoints', 'discard');
I hope you find the above explanation and suggestions useful!

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by