Delete all rows from a cell array

4 visualizaciones (últimos 30 días)
Gauravveer Singh
Gauravveer Singh el 5 de Jul. de 2021
Editada: Yongjian Feng el 5 de Jul. de 2021
I have a cell array of 1x24 tables and all have stored variables and contain numeric values . I want to delete all the rows by looking at one variable in whose value is greater than 7 .
Thank you in advance
  1 comentario
Image Analyst
Image Analyst el 5 de Jul. de 2021
Can you attach your cell array containing tables in a .mat file with the paperclip icon?
save('answers.mat', 'yourCellArray');
Which cell or table row or table column contains "one variable in whose value is greater than 7"? Where are we supposed to look for the values above 7? I have no idea.

Iniciar sesión para comentar.

Respuestas (1)

Yongjian Feng
Yongjian Feng el 5 de Jul. de 2021
arr = cell2mat(cellArray); % convert to array first
arr(arr>7) = []; % remove
cellArray = num2cell(arr); % convert back
  2 comentarios
Gauravveer Singh
Gauravveer Singh el 5 de Jul. de 2021
thanks a lot
Yongjian Feng
Yongjian Feng el 5 de Jul. de 2021
Editada: Yongjian Feng el 5 de Jul. de 2021
If it works, accept the answer please.

Iniciar sesión para comentar.

Categorías

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

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by