Applying a function only to certain rows in a table, marked by the start of the name.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi and Hello,
I am currently working on a big set of data that is saved in a table.
The First collum is the Name of the Individual rows like "AB12_345678", AC12_345678
The rest of the collums contain different values. (doubles and numbers)
I am trying to figure out how to apply a function like mean or max only to those rows, thats name start with e.g "AB1".
I had no success with substrings, startsWith or rowfunc.
I am truly lost on how to do this since i want to avoid selecting the data by hand and running the code like 75 times.
Any and all help would be appreaciated.
Thanks in advance!
0 Kommentare
Akzeptierte Antwort
Saurabh
am 6 Jun. 2023
you can use the startsWith function from the Text Analytics Toolbox to select the rows of a table whose name starts with a certain keyword.
And then accordingly You can access the rest of the values if you have the idices of the Table, thats name start with e.g "AB1".
Let me Know if this works.
startStr = "AB1";
idx = startsWith(string(file_name.PropertyName), startStr);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu LaTeX finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!