struct2pairs( struc )
Version 1.0.0.0 (272 Bytes) by
Roman Müller-Hainbach
Create cell-array with pairs of field name and field value.
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 LinuxCategories
Find more on Structures in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |