look for data in cell array and avoid certain data during that search

1 visualizzazione (ultimi 30 giorni)
Can any one help me to write a code on below condition. I have a cell which have 10 entries. I need to look specific char in that cell array if that found i need to get line number of that specific data in integer format. At the same i need to avoid certain data that will count. for example a b (c) d e (f) g here am looking for (f) so i need to get line number as 5. Because i need to avoid all data that are in () while counting for line number . after first execution i need to look for (c) and then continue for other data that are in (c).

Risposte (1)

Max Heimann
Max Heimann il 16 Gen 2022
You could try regexp. It accepts cells of strings and returns the indices of the matches for each cell entry.
If you want to exclude certain data from the count you could eliminate those entries with regexprep or a combination of cellfun and regex first.
The correct expression for your problem depends very much on the contents of your cells.

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by