table / timetable - removing zero columns
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Tables finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!