delete column from matrix
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jonathan Demmer
le 17 Sep 2020
Commenté : Stephen23
le 17 Sep 2020
Hi all,
I have a matrix 6964x1441. I would like to keep the column every 24 (keep column 24, 48, 72 etc) and delete the other which will create a matrix 6964x60. Can someone help me pelase?
regards
Jonathan
0 commentaires
Réponse acceptée
Stephen23
le 17 Sep 2020
Where M is your matrix:
M = M(:,24:24:end)
3 commentaires
Stephen23
le 17 Sep 2020
"I have 15 matrices (6964x1441) and I want all of them to be (6964x60)... Do you know if a loop could do that for all of them?"
C = {M1, M2, M3, ..., M15};
for k = 1:numel(C)
C{k} = C{k}(:,24:24:end);
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!