Skip to Main Content Skip to Search
Product Documentation

ldivide, rdivide - Left or right array division

Syntax

ldivide(A,B)
A.\B
rdivide(A,B)
A./B

Description

ldivide(A,B) and the equivalent A.\B divides each entry of B by the corresponding entry of A. A and B must be arrays of the same size. A scalar value for either A or B is expanded to an array of the same size as the other.

rdivide(A,B) and the equivalent A./B divides each entry of A by the corresponding entry of B. A and B must be arrays of the same size. A scalar value for either A or B is expanded to an array of the same size as the other.

Examples

A = [1 2 3;4 5 6];
B = ones(2, 3);
A.\B

ans =

    1.0000    0.5000    0.3333
    0.2500    0.2000    0.1667

See Also

Arithmetic Operators \,/ | mldivide | mrdivide

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS