Documentation

### This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

# minutes

Duration in minutes

## Syntax

``M = minutes(X)``

## Description

example

````M = minutes(X)` returns an array of minutes equivalent to the values in `X`. If `X` is a numeric array, then `M` is a `duration` array in units of minutes.If `X` is a `duration` array, then `M` is a `double` array with each element equal to the number of minutes in the corresponding element of `X`. The `minutes` function converts between `duration` and `double` values. To display a duration in units of minutes, set its `Format` property to `'m'`.```

## Examples

collapse all

```X = magic(4); M = minutes(X)```
```M = 4x4 duration array 16 min 2 min 3 min 13 min 5 min 11 min 10 min 8 min 9 min 7 min 6 min 12 min 4 min 14 min 15 min 1 min ```

Create a `duration` array.

`X = hours(2:10:38) + minutes(30)`
```X = 1x4 duration array 2.5 hr 12.5 hr 22.5 hr 32.5 hr ```

Convert each duration in `X` to a number of minutes.

`M = minutes(X)`
```M = 1×4 150 750 1350 1950 ```

View the data type of `M`.

`whos M`
``` Name Size Bytes Class Attributes M 1x4 32 double ```

## Input Arguments

collapse all

Input array, specified as a numeric array, duration array, or logical array.

Download eBook