delete columns inside a cell based on null elements

조회 수: 1 (최근 30일)
Alberto Acri
Alberto Acri 2023년 6월 23일
편집: Matt J 2023년 6월 23일
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:

채택된 답변

Matt J
Matt J 2023년 6월 23일
편집: Matt J 2023년 6월 23일
map = cellfun('isempty',union_cell)
tf=all( map(3:5,:),1);
union_cell(:,tf)=[]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by