table / timetable - removing zero columns
Show older comments
My answer is:
function pTable = aRemoveZeroTableColumns(primersTable)
%
%
%
pTable = primersTable;
indexes = [];
for i = 1:numel(primersTable.Properties.VariableNames)
column = primersTable{:,i};
if all(column == 0)
indexes = [indexes, i];
end
end
pTable(:,indexes) = [];
end
Is there a shorter solution?
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!