Rank: 22992 based on 0 downloads (last 30 days) and 0 file submitted



Personal Profile:
Professional Interests:


Watch this Author's files


Comments and Ratings by nan View all
Updated File Comments Rating
11 Sep 2012 xml_io_tools Read XML files into MATLAB struct and writes MATLAB data types to XML Author: Jaroslaw Tuszynski

Works beautifully with several versions of Matlab; I really love the way it handles comments, too.

I wanted to suppress some of the terminal output, since I use large xml files and generally am only interested in small sections in any one program. There's an easy way to get around that, but since it took me awhile to find it, I'll share it:

t=evalc('[mystruct tree] = xml_read(cfgfile);');
if ~isempty(t)

27 Jun 2012 Read netCDF files and display variable information Loads netCDF files and displays info about variables. Tested for ERA and NCEP/NCAR reanalysis data. Author: Christian Stranne

Thanks, this was very close to what I was looking for and worked as an example of using the low level NetCDF routines.

I wanted to pass the data back to a calling routine as a structure, and also wanted to remove the singleton dimensions, so I updated the getVar call to:
eval(['dstruct.' varname '= double(squeeze(netcdf.getVar(ncid,i)));']) ;

Since I also wanted to load the attributes into another structure, I needed to add some steps to handle attribute names that are not legal field names, converting spaces etc to underscores; also the assign statements for character attributes needed to be modified for that.

An excellent example file for the Matlab help would be a routine that loads a NetCDF file, modifies some fields, and writes out a new NetCDF. That would cover all the bases, I think. In the absence of that, this was a big help - thanks!

04 Oct 2011 Graphically display the 'branch' structure of a struct variable Recursive function designed to display the 'branch' structure of struct variables. Author: Andrew

This works really well.

I decided I wanted to display the contents of singletons and strings, instead of their size and type, since I'm storing metadata in complex structures. That update was easy to add, a couple of lines checking the size and type. The original will also be useful when I really just want the structure itself.
Thanks for sharing this, Andrew.

04 Oct 2011 Unfold structures Unfold and show the content of the given structure. Author: Thomas Schaffter

Works fine, thanks. Of course I have one suggestion!

Instead of requiring that the structure name be passed separately as a string, get the name by calling inputname(1). I found that useful little trick here on File Exchange, in the structstuct function.

Contact us