How to divide array, that result would be like dividing columns?
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Mantas Vaitonis
 il 14 Lug 2018
  
    
    
    
    
    Modificato: Walter Roberson
      
      
 il 14 Lug 2018
            Hello, Can somebody give a little explanation about matrix division? For example there are two arrays a (100x5) and b (100x5). If I try to left divide two columns;
c=a(:,1)\b(:,1);
Result is c(1x1), However if I try to divide both arrays:
C=a\b;
Result is c(5x5), why it is not c(1x5)? As I understand it is different when dividing columns vs dividing matrix.
0 Commenti
Risposta accettata
  Walter Roberson
      
      
 il 14 Lug 2018
        
      Modificato: Walter Roberson
      
      
 il 14 Lug 2018
  
      All combination of columns are used.
a(:,1)\b(:,1) a(:,1)\b(:,2) a(:,1)\b(:,3) ...
a(:,2)\b(:,1) a(:,2)\b(:,2) a(:,2)\b(:,3) ...
You could do
arrayfun(@(COL) A(:,COL)\B(:,COL), 1:size(A,2))
0 Commenti
Più risposte (0)
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!