MATLAB: How to do foward right division

right division

I have an array of A (1×182) and B (1×182). When I use C=A/B; it gives one single number. How did Matlab get that single number?
I understand if I use ./ I will get C=(1×182).

Best Answer

The / operator ( mrdivide) is particular to matlab. It solves a system of linear equations. In your particular case, it finds x such that x*B = A (note the reversal of the order of A and B) using the least square method, so it basically performs a linear fit between A and B with the added constraint that the line goes through the origin.
The traditional division is always ./ ( rdivide)