Code covered by the BSD License  

Highlights from
NetCDF reader

4.52381

4.5 | 21 ratings Rate this file 119 Downloads (last 30 days) File Size: 2.65 KB File ID: #15177

NetCDF reader

by Paul Spencer

 

02 Jun 2007 (Updated 05 Jun 2007)

Reads NetCDF files into matlab structure

| Watch this File

File Information
Description

Function to read version 1 (classic 32bit) NetCDF files into a matlab structure.

MATLAB release MATLAB 7 (R14)
Other requirements Currently only tested under 32bit windows.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (27)
04 Jun 2007 Kelly Kearney

This is a nice complement to some of the more powerful netcdf libraries available. Becuase it reads in an entire file at once, it can only deal with small .nc files, but is much less hassle than the mexnc library I usually use. However, it would be nice if it did some checks ahead of time to see if the file it's reading is too big to be read into Matlab all at once (based on the header data), and errored out immediately, rather trying to do the impossible.

11 Jun 2007 FAISA MOHTI

good

22 Jun 2007 Patrick Gagnon

It's by far the simplest way that I found to read netcdf data in Matlab R14.

22 Oct 2007 Liam Harrington-Missin

Very Easy to use and quick, at least for smaller NetCDF files

23 Nov 2007 Ibrahim Modibbo

Wow! I cant believe it...even people's comments until i saved this file into my working dir and used it in place of load on matlab prompt...my file is there!
Thats a great job!

Will it be possible for you to extend this for ARGO data, and possibly how to make some few plots? This would have added extreme help to many people! Pls reply me....

I am PhD student at National Oceanography Centre, Southampton, UK.

Hope to hear from you!

Cheers!

21 Jan 2008 ali altalhy  
29 Jan 2008 w s

Thanks a lot. Exactly what I needed.

08 Apr 2008 D Luna

Great! Fantastic!

06 May 2008 Patrizio M

thanks

17 May 2008 Usama Anber

great, but how to visualize climate data on a map ?

03 Jun 2008 ramy MAROUS  
27 Jul 2008 Niranjan kumar

I am extreamly thank you

10 Sep 2008 William Amidon

works beautifully. Thank you so much. This is a great help for us matlab users trying to work with large climate datasets.

30 Sep 2008 Jian Xu

I really need this function, I hope it's helpful..

21 Oct 2008 roc light  
22 Jan 2009 naratip santitissadeekorn

??? Error using ==> feval
Undefined function or method 'mexcdf60' for input arguments of type 'char'.

What should I do to resolve the above error?
I am totally new to this type of data and mex-files. Please, help.

26 Feb 2009 Richard Sonnenfeld

I haven't used it heavily yet so there may still be issues -- but it appears that this script works just fine for Matlab in Linux. (Ubuntu/Debian). It really ought to -- NETCDF is supposed to be platform agnostic.

20 May 2009 Michael Kleder

Excellent submission. Note that unsigned integer variables (uint8) seem to be loaded as signed integers (int8). I use the typecast function to correct that. I haven't checked for any other bugs. Thanks for this really useful function!

16 Oct 2009 Imtiaz Rangwala

visualize netcdf

28 Feb 2010 Pavel ?

excellent work!

31 Mar 2010 Alice

I've downloaded netcdf.m file. In which folder I have to put it?I use Matlab 7.7 r2008b. Please help me! Thanks

17 May 2010 roberto

I am using netcdf.m file with .nc format but I got this error:
Error using ==> reshape
To RESHAPE the number of elements must not change.
The outcome contains only 2 out of 3 matrix.
What should I do to resolve the error?
thanks

31 Aug 2010 Mainul

I tried to extract COSMIC ionPrf file runing netcdf.m . It reads only the header information (NumRecs: 0). I need to read data records. Can any one tell me how to read data?

21 Jan 2011 Justin Winokur

Thanks for this. In our group, a few people have the newer 2010 version of Matlab with a built in netCDF library. This is good for one of my machines that does not have it. A few tweaks to my own codes here and there to use it but it works nicely. I am using it under SUSE.

03 Feb 2011 Brian Emery  
26 Apr 2011 Lisa  
21 Jul 2011 sana hamouda

Thank you very much for this code it seems work but I can't use struct file on matlab Could you please help me to extract the variables from S

Please login to add a comment or rating.
Updates
05 Jun 2007

Updated to allow for the reading of selected data arrays and records

Tag Activity for this File
Tag Applied By Date/Time
data import Paul Spencer 22 Oct 2008 09:14:16
data export Paul Spencer 22 Oct 2008 09:14:16
netcdf Paul Spencer 22 Oct 2008 09:14:16
reader Paul Spencer 22 Oct 2008 09:14:16
matlab Paul Spencer 22 Oct 2008 09:14:16
utilities Paul Spencer 22 Oct 2008 09:14:16
data Paul Spencer 22 Oct 2008 09:14:16
i got this error messaeg error using feval undefined function or naratip santitissadeekorn 22 Jan 2009 01:35:56
data ks fu 26 Feb 2009 00:59:22
data Tarun Verma 26 Feb 2009 05:01:16
netcdf Vincent 28 May 2009 08:00:58
matlab Stelios Flamp 09 Feb 2010 10:37:40
data Stelios Flamp 09 Feb 2010 10:37:47
data export Stelios Flamp 09 Feb 2010 10:37:50
in which folder i have to put it i use matlab 77 r2008b please h Alice 31 Mar 2010 04:53:29
ive downloaded netcdfm file Alice 31 Mar 2010 04:53:29
ive downloaded netcdfm file Alireza Balalan Fard 01 May 2010 10:37:06
data export roberto 17 May 2010 09:11:35
netcdf roberto 17 May 2010 09:11:42
reader David Schneider 07 Aug 2010 05:03:20
netcdf David Schneider 07 Aug 2010 05:03:30
data import David Schneider 07 Aug 2010 05:03:44
data David Schneider 07 Aug 2010 05:03:47
reader LU 04 Nov 2010 15:07:12
data Estefanía 25 Aug 2011 16:21:19
data jun 14 Sep 2011 23:15:14
netcdf Rivkin 14 Oct 2011 08:37:53
data Jichao 05 Dec 2011 03:02:44

Contact us at files@mathworks.com