Borrar filtros
Borrar filtros

Sum function with letters

4 visualizaciones (últimos 30 días)
Matrix-Matlab
Matrix-Matlab el 23 de Abr. de 2017
Respondida: Stephen23 el 23 de Abr. de 2017
Hello,
I have a dataset of 1000x3 in which I have names and numbers. It has been imported from excel using xlsread.
The issue I have is with counting the number of observations I have with a word. I.E AIR 6 - how many times does that occur?
Im trying to use sum function and if statement, but I am not able to get anything useful.
Please, someone help me.

Respuestas (1)

Stephen23
Stephen23 el 23 de Abr. de 2017
Where C is a cell array of strings:
nnz(strcmp(C,'AIR 6'))

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by