Making Matrix Dimensions Equal
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Suki Sule
 el 9 de Mzo. de 2016
  
    
    
    
    
    Respondida: Ilham Hardy
      
 el 9 de Mzo. de 2016
            I have a matrix 5130 x 2 (5130 rows and 2 columns). A second matrix is 2150 x 2. How can I make this equal to 5130 x 2 without losing or adding information, for instance by adding or subtracting zeros?
0 comentarios
Respuesta aceptada
  Ilham Hardy
      
 el 9 de Mzo. de 2016
        A = ones(5130,2);
B = ones(2150,2);
BA = vertcat(B,zeros(abs(length(A)-length(B)),2));
How come that this does not count as adding information? :)
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

