Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Check if number in Row, if not delete the complete column

1 visualización (últimos 30 días)
Marv
Marv el 13 de Oct. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello, this is the Data:
TestData = {'A','B','C','D';...
3,4,8,7;...
4,9,5,9;...
5,[],2,[];...
7,[],2,[];...
1,[],6,[]}
1. Check if in row 4 is a number
2. If not, delete the complete column where is not a number.
3. In this case this means: Delete column B and D.
The real data is very big, over 10000 rows...
How can I do this ?
  1 comentario
Image Analyst
Image Analyst el 13 de Oct. de 2015
Is this homework? Sounds like it? If so, tag it as homework.

Respuestas (1)

goerk
goerk el 13 de Oct. de 2015
You can try this
mask = cellfun(@isempty, TestData);
deleteColumn = sum(mask)>0;
TestData(:,deleteColumn) = [];

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by