plz help how can repetition rows matrix
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how can repetition rows matrix deponds number if i have a=[ 1 0 0 ;0 0 1; 0 1 0] and n=4
i wanna have rep_a=[ 1 0 0; 0 0 1; 0 1 0 ;1 0 0]
if n=5 rep_a=[ 1 0 0; 0 0 1; 0 1 0 ;1 0 0;0 0 1]
2 commentaires
Réponse acceptée
Jan
le 24 Juil 2021
a = [1 0 0; 0 0 1; 0 1 0];
rows = size(a, 1);
n = 5;
index = rem(0:n-1, rows) + 1
b = a(index, :)
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!