ドキュメンテーション
最新のリリースでは、このページがまだ翻訳されていません。 このページの最新版は英語でご覧になれます。
配列を 90 度回転
B = rot90(A)
B = rot90(A,k)
例
B = rot90(A) は配列 A を反時計回りに 90 度回転させます。多次元配列では、rot90 は 1 番目の次元と 2 番目の次元で形成される平面で回転します。
A
rot90
B = rot90(A,k) は、k が整数のとき、配列 A を反時計回りに k*90 度回転させます。
k
k*90
すべて折りたたむ
連番要素の列ベクトルを作成します。
A = (1:5)'
A = 5×1 1 2 3 4 5
rot90 を使用して A を反時計回りに 90 度回転させます。
B = 1×5 1 2 3 4 5
結果 B は、A と同じ要素をもちますが方向は異なります。
B
3 x 3 x 2 の文字の cell 配列を作成します。
A = cat(3,{'a' 'b' 'c';'d' 'e' 'f';'g' 'h' 'i'},{'j' 'k' 'l';'m' 'n' 'o';'p' 'q' 'r'})
A = 3x3x2 cell array A(:,:,1) = {'a'} {'b'} {'c'} {'d'} {'e'} {'f'} {'g'} {'h'} {'i'} A(:,:,2) = {'j'} {'k'} {'l'} {'m'} {'n'} {'o'} {'p'} {'q'} {'r'}
cell 配列を 270 度回転させます。
B = rot90(A,3)
B = 3x3x2 cell array B(:,:,1) = {'g'} {'d'} {'a'} {'h'} {'e'} {'b'} {'i'} {'f'} {'c'} B(:,:,2) = {'p'} {'m'} {'j'} {'q'} {'n'} {'k'} {'r'} {'o'} {'l'}
この関数は配列の各ページを個別に回転させます。360 度 (k = 4)、つまり 1 回転した場合は、配列に変化はないため、rot90(A,3) は rot90(A,-1) と等価です。
k = 4
rot90(A,3)
rot90(A,-1)
入力配列。ベクトル、行列または多次元配列として指定します。
データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char | string | struct | cell | categorical | datetime | duration | calendarDuration 複素数のサポート: あり
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
char
string
struct
cell
categorical
datetime
duration
calendarDuration
回転定数。整数で指定します。rot90 を入れ子にして呼び出すのではなく、k を指定して k*90 度回転させます。
例: rot90(A,-2) は A を -180 度回転させます。180 度回転させる rot90(A,2) と等価です。
rot90(A,-2)
rot90(A,2)
任意の次元で配列を反転するには、関数 flip を使用します。
flip
使用上の注意事項および制限事項:
最初の引数では cell 配列をサポートしません。
この関数は GPU 配列を完全にサポートしています。詳細については、GPU での MATLAB 関数の実行 (Parallel Computing Toolbox)を参照してください。
この関数は分散配列を完全にサポートしています。詳細については、分散配列を使用した MATLAB 関数の実行 (Parallel Computing Toolbox)を参照してください。
flip | fliplr | flipud
fliplr
flipud
A modified version of this example exists on your system. Do you want to open this version instead? (ja_JP)
MATLAB のコマンドを実行するリンクがクリックされました。
このリンクは、Web ブラウザーでは動作しません。MATLAB コマンド ウィンドウに以下を入力すると、このコマンドを実行できます。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office