How to swap multiple rows of a matrix at a time
    7 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Meghan Holland
 il 23 Nov 2020
  
    
    
    
    
    Commentato: Meghan Holland
 il 23 Nov 2020
            Hi. I have a fairly large matrix (generated from an image) that I need to swap rows in. I need to swap multiple rows at a time (rows 1:63 with rows 142:201, roughly) and display this new image. I see a lot of examples of swapping indivual rows in small matrices, but nothing about swapping multiple rows at a time or swapping rows in large matrices, so how do I do this?
0 Commenti
Risposta accettata
  James Tursa
      
      
 il 23 Nov 2020
        
      Modificato: James Tursa
      
      
 il 23 Nov 2020
  
      A = your matrix
A([1:63,142:202],:) = A([142:202,1:63],:);
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

