
What is A/B when A and B are 1x3 row vectors
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Ashish Sheikh
      
 am 7 Mär. 2015
  
    
    
    
    
    Bearbeitet: Matt J
      
      
 am 8 Mär. 2015
             This is so simple...i think i'm missing some thing
What is the result of A/B ???? (if A and B are same length row vectors)
ex: A=[1 2 3]; B=[4 5 6];
A/B in MAtlab gives me 0.4156
0 Kommentare
Akzeptierte Antwort
  Matt J
      
      
 am 7 Mär. 2015
        
      Bearbeitet: Matt J
      
      
 am 8 Mär. 2015
  
      I want to know how this gives me 0.4156 ??? A/B is A*inv(B) ....
A/B is always defined as the least squares solution to the equation,
     A=X*B
or
     min. f(X) = norm(A-X*B)
In this case, the solution X has to be a scalar, since that is the matrix shape that can be left multiplied with B to produce another 1x3 matrix A. You can readily confirm that X=0.4156 is the minimizing value by plotting f(X),
    >> fplot(@(X)norm(A-X*B),[0.41,.42])

0 Kommentare
Weitere Antworten (1)
  Star Strider
      
      
 am 7 Mär. 2015
        
      Bearbeitet: Star Strider
      
      
 am 7 Mär. 2015
  
      You’re likely not missing anything other than an slightly more inclusive interpretation of that operation. You’re doing a linear least-squares fit through the origin on ‘A’ as a function of ‘B’.
To illustrate symbolically:
A=[1 2 3]; B=[4 5 6];
P = A/B;                        % ‘P’ = Parameter ‘Vector’ (1x1 Here)
R = P*B;                        % Regression Line
figure(1)
plot(B, A, 'p')                 % Plot Data
hold on
plot(B, R, 'LineWidth',1.5)     % Plot Regression
plot([0 4], P*[0 4], '--r')     % Extend To Origin
hold off
axis([0  8    0  4])
grid
and to illustrate literally:

4 Kommentare
  Star Strider
      
      
 am 7 Mär. 2015
				My pleasure!
You can now Accept two answers, if you want to Accept mine as well.
Siehe auch
Kategorien
				Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


