problem with using the function movcorr to compute moving error
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Steven Lord
el 10 de Jul. de 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.
Respuestas (1)
Garmit Pant
el 12 de Jul. de 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!
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!