Borrar filtros
Borrar filtros

delete columns inside a cell based on null elements

2 visualizaciones (últimos 30 días)
Alberto Acri
Alberto Acri el 23 de Jun. de 2023
Editada: Matt J el 23 de Jun. de 2023
Hi! In this example:
union_cell = importdata("union_cell.mat");
I should know whether in the block included by rows 3:5 and columns 2:6, there are columns characterized by all null elements.
For example, columns 4:6 have the three rows with null elements. I need to delete those columns and get this:

Respuesta aceptada

Matt J
Matt J el 23 de Jun. de 2023
Editada: Matt J el 23 de Jun. de 2023
map = cellfun('isempty',union_cell)
tf=all( map(3:5,:),1);
union_cell(:,tf)=[]

Más respuestas (0)

Categorías

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

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by