Change matrix dimensions and keep the order
    2 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    David du Preez
 le 10 Mai 2017
  
    
    
    
    
    Réponse apportée : Guillaume
      
      
 le 10 Mai 2017
            I have a 1 x 744 matrix that contains hourly data for one month. The 24 columns contain the data for one day the next 24 for the next day so on. I want to change to a matrix of 31 x 24 so that I would have the 31 days of data below each other
0 commentaires
Réponse acceptée
  Guillaume
      
      
 le 10 Mai 2017
        Use reshape. Because matlab is column-major and you want your data in row-major order, you'll reshape into 24 rows and then transpose:
result = reshape(yourmatrix, 24, []).'
0 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!
