delete columns inside a cell based on null elements

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 日

0 投票

map = cellfun('isempty',union_cell)
tf=all( map(3:5,:),1);
union_cell(:,tf)=[]

その他の回答 (0 件)

カテゴリ

製品

リリース

R2021b

質問済み:

2023 年 6 月 23 日

編集済み:

2023 年 6 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by