Diluting large arrays by eliminating columns whose numbers are factos of an integer
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dealing with a numerical problem, sometimes my program ends up producing large data arrays(e.g. 100X1000). Due to numerical limits I cannot make the program work with smaller steps (and smaller arrays as a consequence) but I would like to "dilute" the results matrix to e.g. a tenth of the original number of columns. This means when I want to write the data to an excel file at the end, I would rather only write every tenth column of the whole array into the output file. How can I do this without using a loop?
0 commentaires
Réponse acceptée
Walter Roberson
le 5 Nov 2017
start_col = 10;
data_to_write = your_data(:, start_col:10:end);
Adjust start_col according to whether you want columns 1, 11, 21, ... written, or columns 10, 20, 30, ... written
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!