Remove table columns that contain any 'Inf' value
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dear MATLAB experts,
I'm trying to remove all columns from a table that contain (once or more) so called 'Inf' values. I have tried the code below so far, but it has not worked. Thank you in advance.
stock_returnsTable = stock_returnsTable(:,~any(isinf(stock_returns)));
0 Kommentare
Antworten (1)
C B
am 6 Okt. 2021
modified = stock_returnsTable{:,:}
output = modified(:, all(~isinf(modified), 1))
stock_returnsTable =
5×4 table
A B C D
__ ___ ___ ___
71 176 Inf 12
69 163 163 163
64 131 131 131
67 133 133 133
64 Inf 33 33
modified =
71 176 Inf 12
69 163 163 163
64 131 131 131
67 133 133 133
64 Inf 33 33
output =
71 12
69 163
64 131
67 133
64 33
0 Kommentare
Siehe auch
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!