Applying a function only to certain rows in a table, marked by the start of the name.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
VeHe
el 6 de Jun. de 2023
Comentada: Saurabh
el 6 de Jun. de 2023
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 comentarios
Respuesta aceptada
Saurabh
el 6 de Jun. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre LaTeX en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!