Get netCDF data from Copernicus Marine

11 次查看(过去 30 天)
Hi,
I am trying to get some netCDF data from the Copernicus marine software following their guidelines step by step. This is the code I am using:
% Copernicus Marine username and password
USERNAME = "-------"; %My username
PASSWORD = "------------"; % My password
server = "@nrt.cmems-du.eu"; % Copernicus Marine server
datasetID = "cmems_mod_ibi_phy_anfc_0.027deg-3D_P1D-m"; % datasetID
file_nc = strcat("https://", USERNAME, ":", PASSWORD, server, "/thredds/dodsC/", datasetID);
ncdisp(file_nc)
My matlab version is the 2018a, and apparently this code fails computing the last line of the code. However, a colleague who has the 2020a version is able to obtain the data with the same code. Can this be due to the Matlab version?
Thanks in advance!

回答(1 个)

Udit06
Udit06 2024-9-2
Hi Asier,
I understand that you are trying to access netCDF data using an OPeNDAP URL using the "ncdisp" function in MATLAB R2018a while you are able to access the same data using MATLAB R2020a.
The following MATLAB answer handles a similar issue:
The answer suggests that this is a sporadic issue and it is less frequent with newer versions of MATLAB. Therefore, the most suitable workaround in your case will be to use MATLAB R2020a where your colleague was able to access the data. Other suggestion includes to verify the link first on browser to check if it is a valid link.
I hope this helps.

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by