Use strcmp() based on part of the row name in structure

2 views (last 30 days)
Hi everyone,
I have a structure (DATA) with 3 fields (name, folder, data (tables)). There are many rows with names (field name) in a pattern as follows :
I want to make a new structure that keeps only the rows with 'XXX_XXX_Fire.txt', no matter what is before.
I have tried this :
FIRE = DATA(strcmp({}, '%s_%s_Fire.txt'))
which obviously doesn't work.
However, it works like this :
FIRE = DATA(strcmp({}, 'London_SecondVariable_Fire.txt'))
but this way I only get this one row, and I would rather not have to write each name in separate lines but something to get all the rows with a name containing Fire.txt
Any idea ?
Thanks for your help :)

Accepted Answer

Stephen23 on 7 Apr 2022

Sign in to comment.

More Answers (0)


Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!