struct2pairs( struc )

Create cell-array with pairs of field name and field value.
19 Downloads
Updated 31 Jul 2017

View License

Storing a number of Name-Value-Pairs as a structure is convenient, maintainable and easy to read in code. User struct2pairs when passing them into a function.
Example:
...
lineconfig = struct( 'Color','r', 'LineStyle','--', 'MarkerSize',3, ... );
pairs = struct2pairs(lineconfig);
plot(data,data, pairs{:})

Cite As

Roman Müller-Hainbach (2024). struct2pairs( struc ) (https://www.mathworks.com/matlabcentral/fileexchange/63930-struct2pairs-struc), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Structures 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.0.0.0