Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - 日本語

Change language to:
English - Français - Português

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

Scilab manual >> Elementary Functions > resize_matrix

resize_matrix

異なる大きさの新規行列を作成

呼び出し手順

resMat = resize_matrix(mat,nbRow,nbCol,[typeOfMat])

パラメータ

mat

入力行列で, この行列から大きさが変更された行列が 作成されます.

nbRow

大きさが変更される行列の行の数.

nbCol

大きさが変更される行列の列の数.

typeOfMat

文字列, 大きさが変更される行列の型名.

resMat

大きさが変更された行列.

説明

大きさ nbRow x nbCol の行列を作成し, (i,j)が入力行列の範囲の場合, その要素(i,j)mat(i,j)とします. それ以外の場合, 要素 (i,j)は 実数または整数行列の場合に 0, 論理値行列,文字列行列の空の文字列 の場合に %fとなります.

出力行列の型は typeOfMat 引数で指定することにより修正できます. この場合,入力行列がこの型と互換性があることを確認してください.

現在,実数,整数行列,論理値および文字列行列のみが サポートされています. これは, typeOfMatを 'constant', 'boolean', 'string' または任意の整数型 ('int8', 'int16',...)の中から選択する必要があることを意味します.

// 数値行列
myMat = 5 * rand( 3, 4 )
myMat = resize_matrix( myMat, 3, 3 ) // 行列の大きさを縮小
myMatInteger = resize_matrix( myMat, 4, 4, 'int32' ) // 整数行列を作成
myMatBoolean = resize_matrix( myMat, 2, 2, 'boolean' )
myMatBoolean = resize_matrix( myMatBoolean, 3, 5 )

// 文字列行列
myMatString = ["Scilab","the";"Open Source","Scientific";"Software","Package"]
myMatString = resize_matrix( myMatString, 3, 1 )

作者

Jean-Baptiste Silvy

<< real Elementary Functions setdiff >>

Copyright (c) 2022-2023 (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:
Wed Jan 26 16:25:04 CET 2011