# `numlib`::`divisors`

Divisors of an integer

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```numlib::divisors(`n`)
```

## Description

`numlib::divisors(n)` returns the list of positive divisors of `n`.

If `a` is a non-zero integer then `numlib::divisors(a)` returns the sorted list of all positive divisors of `a`.

`numlib::divisors(0)` returns `[0]`.

`numlib::divisors` returns an error if the argument evaluates to a number of wrong type.

## Examples

### Example 1

We compute the list of all positive divisors of 72:

`numlib::divisors(72)`

### Example 2

`numlib::divisors` returns the positive divisors of negative numbers, too:

`numlib::divisors(-63)`

## Parameters

 `n` Integer

## Return Values

`numlib::divisors` returns a list of nonnegative integers.

## Algorithms

Internally, `ifactor` is used for factoring `n`.

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos