I have a MATLAB structure with 20 fields. My structure is for example called Data and I only want to concentrate on five of them.
My important field is Data.Options. It has 3000x1 cells. It has patterns like "pt002", "gm010", "mde02" etc. in it.
The other field is Data.specifics. It also has 3000x1 cells, and it contains information relative to the rows in Data.Options.
I have two other fields of Data.Up and Data.Down with 3000x1 cells again and they contain information relative to the rows in Data.specifics. These two fields only store numbers like 1, 2, 3, etc.
My other field I would like to keep is Data.components. It has 1100x1 cells. It is basically the components that are found in Data.specifics. For example, if one row of Data.specifics is: A*D = C, Data.specifics contains A and D and C in different rows.
Now I would like to extract a subset of Data.Options which has patterns of "mtc03" and "yhk90" in it and based on that, I also want to keep the rows of that fields in which these patterns are found. I have prepared something like this from previous answers, but it is incomplete:
Components = [Data2.Components]
Specifics = [Data2.Specifics]
Options = [Data2.Options]
Data2.Components = Components(Index);
I don't know if it is correct, or if there is any quicker way. Thanks for any help!