How to values for a matirx
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Iftekharuddin Syed
le 8 Nov 2020
Commenté : Iftekharuddin Syed
le 10 Nov 2020
There is matix A of size 12x1000, How to get elements at the 100's poistions like at 100, 200, 300, ....,1000. And assign it to another matrix/list
Each entry at the 100's position must contains all 12 rows from the original matrix.
I tried something like this
for temp = 0:1000
selected_matrix = a(:,temp+10)
end.
Can anyone suggest me how to do this.
0 commentaires
Réponse acceptée
Ameer Hamza
le 8 Nov 2020
Modifié(e) : Ameer Hamza
le 8 Nov 2020
Try this
a; % 12x1000 matrix
selected_matrix = a(:, 100:100:1000)
Read about indexing in MATLAB: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating 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!