unshiftdata
shiftdata
の逆演算
構文
y = unshiftdata(x,perm,nshifts)
説明
y = unshiftdata(x,perm,nshifts)
は shiftdata
でシフトされたデータの方向を元に戻します。置換ベクトルは perm
で与えられ、nshifts
は shiftdata
から返されたシフト数です。
unshiftdata
は shiftdata
とともに使用します。これらの関数は、filter
、goertzel
、sgolayfilt
、sosfilt
のように、特定の次元を操作する関数を作成する場合に役立ちます。
例
例 1
3-by-3
魔方陣を作成します。x = fi(magic(3))
x = 8 1 6 3 5 7 4 9 2 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 11
行列
x
をシフトし、2 次元方向に操作します。[x,perm,nshifts] = shiftdata(x,2)
x = 8 3 4 1 5 9 6 7 2 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 11 perm = 2 1 nshifts = []
このコマンドで、置換ベクトル
perm
とシフト数nshifts
がシフトされた行列x
とともに返されます。この行列を元の形状に戻します。
y = unshiftdata(x,perm,nshifts)
y = 8 1 6 3 5 7 4 9 2 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 11
例 2
x
を行ベクトルとして定義します。x = 1:5
x = 1 2 3 4 5
dim
を空に定義し、x
の大きさが 1 でない最初の次元を 1 列目にシフトします。[x,perm,nshifts] = shiftdata(x,[])
x = 1 2 3 4 5 perm = [] nshifts = 1
このコマンドで、
x
が列ベクトルとして返され、置換ベクトルperm
とシフト数nshifts
も返されます。unshiftdata
を使用して、x
を元の形状に戻します。y = unshiftdata(x,perm,nshifts)
y = 1 2 3 4 5
バージョン履歴
R2008a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
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:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)