Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Elementary Functions > Matrix - shaping > squeeze

squeeze

removes singleton dimensions of a hypermatrix

Syntax

hypOut = squeeze(hypIn)

Arguments

hypIn

a hypermatrix or matrix of constant type.

hypOut

a hypermatrix or matrix of constant type.

Description

The squeeze function removes singleton dimensions of a hypermatrix, that is any dimension for which the size is 1. If the input hypIn is a matrix, it is unaffected.

Examples

M1 = zeros(2,1,5)
squeeze(M1)
squeeze(M1(:,:,1))

M2 = matrix(1:4, [2 1 2 1])
squeeze(M2)

See also

  • matrix — reshapes an array with the same number and order of components
  • hypermatrices — a Scilab object, N dimensional matrix in Scilab
Report an issue
<< resize_matrix Matrix - shaping Matrix operations >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 14:57:12 CET 2019