kpfield( S, fields )
Version 1.0.0.0 (924 Bytes) by
Michael Sansoni
Keep only specified fields in a structure. Inverse of rmfield.
Function to keep only the specified fields in a structure. Quicker than using rmfield as structure is converted to a cell array before fieldnames are compared logically before converting back to a structure. Much quicker for large structures.
Cite As
Michael Sansoni (2025). kpfield( S, fields ) (https://uk.mathworks.com/matlabcentral/fileexchange/56413-kpfield-s-fields), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2014b
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 |
