greengrass62
greengrass62

Reputation: 986

MATLAB matrix division

Why does A/J yield a result? (I was expecting an error because the matrix J was not square.)

A = [1 3; 4 5];
J = [4,5; 6,7; 8,9];
A/J 
ans = 2×3    
    3.7500         0   -1.7500
    1.0000         0   -0.0000

Upvotes: 0

Views: 116

Answers (1)

Thomas Sablik
Thomas Sablik

Reputation: 16448

Because ans * J == I. / is the matrix division and solves the systems of linear equations X * J = I for X. ./ is the element-wise division.

You can find examples and read about it here.

Upvotes: 2

Related Questions