image thumbnail


version (6.43 MB) by Charles Pelizzari
Imports variables (scalar, string, array, structure) from IDL save files into Matlab workspace.


Updated 27 Sep 2015

View License

Data exchange between Matlab and IDL is a longstanding challenge. Exporting to an intermediate format (CSV, HDF, etc) often does the job, but reading the native archive files of each language into the other would be much simpler.
This is a Matlab GUI that allows restoring variables from an IDL save file. Variables are restored into the Matlab base workspace. Optionally changes names of created variables to lowercase.

Click "Choose IDL File" - use file browser to identify the IDL save file. Variables in the IDL file will be listed indicating their data type (scalar, array, structure, uint8, float32, etc); and for arrays, their dimensions.

Select one or more variables in the display listbox (shift-click, control-click, etc. for multiple selection)

Choose "Convert names to lowercase" if desired. Variables are saved with names (and structure field names) in ALL CAPS so if you find that annoying, click the handy checkbox (actually it's checked by default because I find it annoying).

Click "Restore Selected" - chosen variables will be created in the base Matlab workspace.

Can process all basic IDL numeric, array, string and structure data types. Does NOT restore object references. Does NOT understand ulong64 offsets, thus cannot process files >4GB.

Structures with fields that are arrays or other structures are handled via recursion. This structures within structures feature has not been thoroughly tested - only to one level of nesting. Known to work properly with save files from IDL version 8.1. Since the file format description used to develop the code is several years old (see link below), probably will work with files from earlier versions as well. Does NOT handle compressed files, i.e. the "/COMPRESS" switch in the SAVE command cannot have been used.

Non-GUI version is a function "restore_idl" that takes as input arguments a full pathname for the save file (provides a browser if no valid file specified), and a couple other options: "lowercase" and "verbose". Returns all the variables it can understand from the file in an array of structs with two fields: a string "name", and a cell array "value" which contains whatever the variable happens to be.
Based on description of IDL save file format by Craig Markwardt:

C. Pelizzari, University of Chicago, October 2013

Cite As

Charles Pelizzari (2021). restore_idl (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!