Guide to Installing SDDS support for Matlab

Author: R. Soliday

If you have problems please email me at soliday@anl.gov

Step 1

Download or build the SDDS Java Binary (JAR) file. This is the SDDS.jar file that is included with the SDDS Java Binaries. You can also get it directly from https://ops.aps.anl.gov/downloads/SDDS.jar

Step 2

Download and unpack the SDDS Matlab Release package. This unpacks to epics/extensions/src/SDDS/matlab/

Step 3

Your Matlab scripts should include:

javaaddpath('SDDS.jar', '-end')
    import SDDS.java.SDDS.*
    path(path,'epics/extensions/src/SDDS/matlab')

You will have to add the full pathname for both SDDS.jar and the directory containing the SDDS Matlab Release files.

Step 4

You can now load SDDS files into a Matlab structure. The structure looks like:

sdds.filename
    sdds.ascii
    sdds.pages
    sdds.parameter_names
    sdds.array_names
    sdds.column_names
    sdds.description.contents
                    .text
    sdds.parameter.[parameter name].type
                                   .units
                                   .symbol
                                   .format_string
                                   .description
                                   .data
    sdds.column.[column name].type
                             .units
                             .symbol
                             .format_string
                             .description
                             .page[number]
    sdds.array.[array name].dimensions
                           .type
                           .units
                           .symbol
                           .format_string
                           .group_name
                           .description
                           .size_page[number]
                           .page[number]

The commands for loading and saving SDDS files from Matlab are:

sdds = sddsload('inputFile.sdds') % Load inputFile.sdds
    sddssave(sdds)                    % Save to sdds.filename
    sddssave(sdds, 'outputFile.sdds') % Save to outputFile.sdds

Note: Not all fields are required to save an SDDS file.