problem with using the function movcorr to compute moving error

1 vue (au cours des 30 derniers jours)
Emmanuel
Emmanuel le 10 Juil 2024
Commenté : Emmanuel le 18 Juil 2024
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 commentaire
Steven Lord
Steven Lord le 10 Juil 2024
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.

Connectez-vous pour commenter.

Réponses (1)

Garmit Pant
Garmit Pant le 12 Juil 2024
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 commentaire
Emmanuel
Emmanuel le 18 Juil 2024
Thanks for the explaination, I think I have realized my mistake.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by