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!
  1 件のコメント
Emmanuel
Emmanuel 2024 年 7 月 18 日
Thanks for the explaination, I think I have realized my mistake.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by