Delete fields of struct based on starting characters
Show older comments
Hello everyone. I have a struct called temp which has 5 fields

I want to delete all the fields starting with 'fig' and 'ax'. The final output struct should look something like

I know that we can do it in a complex way using fieldnames and rmfield with multiple lines of code.
Is there any simple way to do this? Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Structures in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!