Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

gdivide

Generalized division

Syntax

gdivide(a,b)

Description

gdivide(a,b) takes two matrices or cell arrays, and divides them in an element-wise manner.

Examples

Divide Matrix and Cell Array Values

This example shows how to divide matrix and cell array values.

gdivide([1 2 3; 4 5 6],[10;20])
ans =

    0.1000    0.2000    0.3000
    0.2000    0.2500    0.3000

gdivide({1 2; 3 4},{1 3; 5 2})
ans =

  2x2 cell array

    {[     1]}    {[0.6667]}
    {[0.6000]}    {[     2]}

gdivide({1 2 3 4},{10;20;30})
ans =

  3x4 cell array

    {[0.1000]}    {[0.2000]}    {[0.3000]}    {[0.4000]}
    {[0.0500]}    {[0.1000]}    {[0.1500]}    {[0.2000]}
    {[0.0333]}    {[0.0667]}    {[0.1000]}    {[0.1333]}

Introduced in R2010b

Was this topic helpful?