zeros

Purpose

Creates a matrix of zeros.

Format

y = zeros(r, c)
Parameters:
  • r (scalar) – the number of rows.

  • c (scalar) – the number of columns.

Returns:

y (RxC matrix) – of zeros.

Examples

y = zeros(3,2);
print y;

The code above produces the following output:

0.000    0.000
0.000    0.000
0.000    0.000

Remarks

This is faster than ones().

Non-integer arguments will be truncated to an integer.

See also

Functions ones(), eye()