File Exchange

image thumbnail


version 1.0.1 (1.88 KB) by Florian Aendekerk
Delete certain array IDs within all fields of a structure.


Updated 24 Oct 2018

View License

Assume you have a structure gps, containing gps.time, gps.lon, and gps.version. The first 3 variables have the same length, gps.version contains a single value for the version. If you want to delete the first 100 entries from the gps time and coordinates from the structure, following code would handle it:

gps = structureDelete(gps,1:100,numel(gps.time));

The script proves most useful with larger structures than the one shown in the example. It runs up to two levels deep, so if above mentioned structure contained gps.coordinate.lon,, it would be handled as well. You can always add another loop in your code in case you want to dig even deeper.

Cite As

Florian Aendekerk (2019). structureDelete (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)



description added

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