- Scilab Online Help
- Elementary Functions
- Discrete mathematics
- Floating point
- Integer representation
- Trigonometry
- abs
- amell
- and
- &
- binomial
- bitand
- bitor
- bloc2exp
- bloc2ss
- cat
- cell2mat
- cellstr
- char
- cumprod
- cumsum
- delip
- diag
- diff
- dsearch
- exp
- eye
- flipdim
- gsort
- imag
- imult
- ind2sub
- intersect
- inttrap
- isdef
- isempty
- isequal
- isequalbitwise
- isreal
- isvector
- kron
- lex_sort
- linspace
- log
- log10
- log1p
- log2
- logm
- logspace
- lstsize
- max
- meshgrid
- min
- modulo
- ndgrid
- ndims
- nextpow2
- norm
- ones
- or
- |
- pen2ea
- permute
- pertrans
- prod
- rand
- real
- resize_matrix
- setdiff
- sign
- signm
- size
- solve
- sqrt
- sqrtm
- squarewave
- ssrand
- sub2ind
- sum
- sysconv
- sysdiag
- syslin
- toeplitz
- trfmod
- trianfml
- tril
- trisolve
- triu
- typeof
- union
- unique
- vectorfind
- zeros
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
resize_matrix
create a new matrix with a different size
Calling Sequence
resMat = resize_matrix(mat,nbRow,nbCol,[typeOfMat])
Arguments
- mat
input matrix from which the resized matrix will be created.
- nbRow
number of row of the resized matrix.
- nbCol
number of column of the resized matrix.
- typeOfMat
caracter string, type name of the resized matrix.
- resMat
resized matrix.
Description
Create a matrix of size nbRow
x
nbCol
and whose elements (i,j)
are
mat(i,j)
if (i,j)
is in the range of
the input matrix. Otherwise elements (i,j)
are
0
for real or integer matrices, %f
for boolean matrices and an empty string for string matrices.
The type of the output matrix may be modified by specifying the
typeOfMat
argument. In this case, be sure that the
input matrix type is compatible with this one.
For now, only real, integer matrices, boolean and character string
matrices are supported. This means that typeOfMat
must
be chosen within: 'constant', 'boolean', 'string' or any integer type
('int8', 'int16',...).
Examples
// number matrix myMat = 5 * rand( 3, 4 ) myMat = resize_matrix( myMat, 3, 3 ) // reduce the matrix size myMatInteger = resize_matrix( myMat, 4, 4, 'int32' ) // create a integer matrix myMatBoolean = resize_matrix( myMat, 2, 2, 'boolean' ) myMatBoolean = resize_matrix( myMatBoolean, 3, 5 ) // string matrix myMatString = ["Scilab","the";"Open Source","Scientific";"Software","Package"] myMatString = resize_matrix( myMatString, 3, 1 )
Authors
Jean-Baptiste Silvy
<< real | Elementary Functions | setdiff >> |