I have a 10x6x5 matrix, I want to convert it into 6x50 matrix. How to do this?
    2 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Masao Nakatani
 il 11 Lug 2018
  
    
    
    
    
    Commentato: Masao Nakatani
 il 12 Lug 2018
            I want to keep second dimension(6 elements) data in the each column vector of the new 2d matrix and there would be 50 (10*5) such columns.
0 Commenti
Risposta accettata
Più risposte (2)
  James Tursa
      
      
 il 11 Lug 2018
        Either this:
A = your 10x6x5 array
result = reshape(permute(A,[2 1 3]),size(A,2),[]);
Or this:
A = your 10x6x5 array
result = reshape(permute(A,[2 3 1]),size(A,2),[]);
Depending on how you want the column data ordered.
  Sri Harish G
      
 il 11 Lug 2018
        If you have a matrix A of size 10x6x5 you can convert it to a matrix of dimensions 6x50 by using
reshape(A,[6,50])
For Information regarding how the elements will be arranged in this matrix, please refer to the documentation and scroll down to "Reshaping Multidimensional Arrays"
https://www.mathworks.com/help/matlab/math/multidimensional-arrays.html
0 Commenti
Vedere anche
Categorie
				Scopri di più su Creating and Concatenating 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!