Unrecognized function or variable 'nc_varget'.
Afficher commentaires plus anciens
Hey Guys!
I am a begginer in MATLAB. I am currently working on a bulky netCDF file downloaded from ISIMIP3b. I wanted to divide my work into two parts: preprocessing and postprocessing. In preprocessing, I want to read a specific variable 'prcp' with the function nc_varget. However, I cannot solve the error "Unrecognized function or variable (nc)". You can help me if you've ever faced such an error and know how to fix it.
2 commentaires
Image Analyst
le 17 Oct 2022
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Walter Roberson
le 17 Oct 2022
Modifié(e) : Walter Roberson
le 19 Oct 2022
The source code for nc_varget does not use any variable named nc or otherwise have any nc that might lead to that message.
Is it possible that when you called the function you passed in the name of a file with nc extension but forgot to enclose the name in apostrophes?
Réponse acceptée
Plus de réponses (1)
4 commentaires
Walter Roberson
le 19 Oct 2022
nc_varget is part of an older third-party toolbox that you have to install. I linked to the source in my comment.
These days you would use ncread() or netcdf.getvar()
Habtamu
le 19 Oct 2022
Walter Roberson
le 20 Oct 2022
Notice the point there, that these days, the tools call the Mathworks functions underneath. If you just need equivalent functionality, then that should be fine, but if you need to "replicate" earlier experiments then it could potentially be important that you match the code as it was at the time.
Habtamu
le 21 Oct 2022
Catégories
En savoir plus sur NetCDF Files dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!