I wrote some code to estimate the p-value empirically:
Alex Backer (2020). xcorrpvalue (https://www.mathworks.com/matlabcentral/fileexchange/75403-xcorrpvalue), MATLAB Central File Exchange. Retrieved May 7, 2020.
Hope it helps.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!