sm4reader(fileID)

Reads RHK's R9's .sm4 data files and converts them to a MATLAB format
225 Downloads
Updated 21 Jun 2017

View License

sm4reader.m takes a file ID of an RHK .sm4 file, then reads and generates:
(1)outfile, a matlab structure containing the reading of (most of) the .sm4 data
(2)formatoutfile, a structure of arranged spatial (e.g. topography), spectral (e.g. I-V spectroscopy) and PLL (phase-locked loop) data.

Note: the data included in the generated .mat files is not all possible measurement types on the RHK microscopes, nor is it a 100% reading of the .sm4 file. The reading is as thorough as we need but it may need extra header reading and/or .mat formatted output depending on the needs of the user.

A more thorough description of sm4reader.m and the formatoutfile structure can be found at:
http://unh2d.weebly.com/using-sm4-files-in-matlab.html
http://unh2d.weebly.com/sm4readerm-and-the-mat-file-format.html

The program was developed in Shawna Hollen's 2D Materials lab at UNH (http://unh2d.weebly.com/).

References used to create this program were two RHK .pdf files:
"Parsing an SM4 file"
"SM4 Data File Format for R9 V5.0"

Inspiration for this program came from Martín Caldarola's "read_sm4_files"
(https://github.com/caldarolamartin/read_sm4_files).

-----------

The output for the file is two structures.

(1) outfile is a structure array with the read data from the .sm4 file. The fields correspond to the pages, header, and data organization the .sm4 file uses. This can be ignored unless you want to access it directly.

(2) formatoutfile is the extracted data formatted to be used in MATLAB analysis. The possible fields are discussed below.

Currently, the formatted output is stored in three main structures:

formatoutfile.Spatial -- stores the information for topographic measurements (e.g. topography, current, dF)

formatoutfile.Spectral -- stores the information for spectroscopy (e.g. I-V, frequency sweep)

formatoutfile.PLL -- stores the information for phase-locked loop if it was on

Cite As

Jason Moscatello (2024). sm4reader(fileID) (https://www.mathworks.com/matlabcentral/fileexchange/62561-sm4reader-fileid), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Predictive Maintenance Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.3.0.0

Now works on FM-AFM, PLL, V-spec, Z-spec, and frequency sweep.

1.2.0.0

Description update.

1.1.0.0

Updated description, not program.

1.0.0.0