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

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ヘルプ >> Elementary Functions > matrixmanipulation > flipdim

flipdim

指定した次元に沿って x ブロック要素を反転

呼び出し手順

y = flipdim(x, dim [,sb])

引数

x, y

任意の型, 同じ大きさのスカラー, ベクトル, 行列またはハイパー行列

dim

正の整数, 反転させる次元の番号

sb

正の整数, 交換するブロックの大きさ

説明

任意の型のスカラー/ベクトル/配列/ハイパー行列 xと 2つの正の整数dimおよびsbを指定すると, この関数は大きさsbのブロック要素により xの次元番号 dim に沿って x の要素を反転します. (x および y は同じ大きさとなります)

オプションパラメータsb (Size Block) により, ブロックの大きさ sb*size(x,2) (dim=1) または size(x,1)*sb (dim=2) での反転が可能となります.

// 例 1: x の要素を最初の次元に沿って反転
x=[1 2 3 4; 5 6 7 8];
dim=1;
y=flipdim(x,dim)
// 例2: x の要素を2番目の次元に沿って反転
dim=2;
y=flipdim(x,dim)
// 例3: x の要素を3番目の次元に沿って反転
x=matrix(1:48,[3 2,4,2]);
dim=3;
y=flipdim(x,dim)
// 例4: 最初の例を複素数に
x = [1+%i 2*%i 3 4; 5 6-%i 7 8*%pi*%i]
dim = 1
y = flipdim(x, dim)
// 整数エンコードされた数値
x = int16(grand(4, 3, 2, "uin", -9, 9))
y = flipdim(x, 1)
// 論理値:
x = (grand(3, 4, "uin", -9, 9) > 0)
y = flipdim(x, 2)
// テキスト:
x = matrix(strsplit("a":"x", 1:23), 4, 6);
x = x+x
flipdim(x, 2)
// 多項式:
x = inv_coeff(grand(3, 9, "uin", 0, 3), 2)
flipdim(x, 1)
// 有理数:
n = inv_coeff(grand(3, 9, "uin", 0, 3), 2);
d = inv_coeff(grand(3, 9, "uin", 0, 3), 2);
r = n./d
flipdim(r, 2)

sbの使用例:

X = [0 1 2 3 4 5 6 7 8 9 10 11];
flipdim(X, 2, 2) // => [10 11   8 9   6 7   4 5   2 3   0 1] // ブロックサイズ = 2.
flipdim(X, 2, 3) // => [9 10 11   6 7 8   3 4 5   0 1 2]
flipdim(X, 2, 4) // => [8 9 10 11   4 5 6 7   0 1 2 3]
flipdim(X, 2, 6) // => [6 7 8 9 10 11   0 1 2 3 4 5]
// sbがxの指定した次元を分割しない場合はエラー.
y = flipdim(x, 2, 5); // size(X) = [1 12] および sb=5 は 12を割り切れない.

履歴

バージョン記述
5.5.0 10進数から任意の型に拡張: 論理値, 整数, 文字列, 多項式および有理数. xブロック毎に反転するために, 新しい入力引数 sbが追加されました.
Report an issue
<< matrixmanipulation matrixmanipulation matrix >>

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:
Thu Oct 02 13:58:21 CEST 2014