if i have two matrix in different size how can i subtract it By adding zeros row or column ??
    2 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Firas Al-Kharabsheh
 le 1 Mai 2016
  
    
    
    
    
    Modifié(e) : Azzi Abdelmalek
      
      
 le 1 Mai 2016
            if i have n X m matrix like this (6,6) i want to make the X in size (6,m/2) by adding zeros row and column
 X_before = [ 1 2 
              1 1
              2 1 ]
so
 X_after = [ 1 2 0 
             1 1 0
             2 1 0
       0 0 0
       0 0 0
       0 0 0 ]
AND i want to this matrix Z to be (n/2,6) like
        Z_before = [ 0 1 1 2 
                     1 1 2 1 ]
       Z_after = [  0 0 0 0 0 0
                    0 1 1 2 0 0
                    1 1 2 1 0 0 ]
0 commentaires
Réponse acceptée
  Azzi Abdelmalek
      
      
 le 1 Mai 2016
        
      Modifié(e) : Azzi Abdelmalek
      
      
 le 1 Mai 2016
  
      x=[1  2  3;4 5 6]
You can add zeros horizontally
n=3
x=[x zeros(size(x,1),n)]
or vertically
x=[x;zeros(n,size(x,2))]
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Logical 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!

