Borrar filtros
Borrar filtros

grpstats for non-numerical data

3 visualizaciones (últimos 30 días)
sarah Abdellahi
sarah Abdellahi el 11 de Oct. de 2018
Respondida: dpb el 11 de Oct. de 2018
Hello Reading the grpstats documentation I realized I can easily count the number of elements that meet 2 conditions like this ( From matlab documentation):
My data is not numeric and a similar command results in an error. How can I count the number of elements that has D_S='0-30' & the damage rate is 'No Damage' ? My table is attached below
The first thing that comes to my mind is to substitute the strings with numbers, but I think there is better way! Thank you

Respuestas (1)

dpb
dpb el 11 de Oct. de 2018
Convert those variables to categorical which is what they are, really, not string. Then, internally to Matlab, they are numerical but the interface is still human-readable.)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by