delete columns inside a cell based on null elements

1 Ansicht (letzte 30 Tage)
Alberto Acri
Alberto Acri am 23 Jun. 2023
Bearbeitet: Matt J am 23 Jun. 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:

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by