Main Content

このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。

coder.resize

coder.Typeオブジェクトのサイズ変更

説明

t_out= coder.resize(t,sz)では、tのサイズがszに変更されます。

t_out= coder.resize(t,sz,variable_dims)では、(上限の) サイズszと可変の次元variable_dimsをもつcoder.Typetの変更されたコピーが返されます。variable_dimsまたはszがスカラーの場合、関数によってtのすべての次元にスカラーが適用されます。既定では、sz0または1で固定の場合は、variable_dimsは次元に適用されません。'uniform' オプションを使用してこの特殊な状況をオーバーライドします。関数coder.resizeはサイズがinfの次元に対するvariable_dimsを無視します。これらの次元は可変サイズです。tは型の cell 配列にでき、その場合はcoder.resizeによって cell 配列のすべての要素のサイズが変更されます。

t_out= coder.resize(t,[],variable_dims)では、サイズはそのままでtが可変の次元variable_dimsをもつようになります。

t_out= coder.resize(t,sz,variable_dims,Name,Value)では、1 つ以上の名前と値のペアの引数で指定された追加オプションを使用して、tのサイズが変更されます。

t_out= coder.resize(t,'sizelimits',limits)では、limitsベクトルに基づいて次元が可変になり,tのサイズが変更されます。次元のサイズSlimitsで定義された最初のしきい値以上の場合、その次元は上限がSの可変サイズになります。次元のサイズSlimitsで定義された 2 番目のしきい値以上の場合、その次元は制限なしの可変サイズになります。

すべて折りたたむ

固定サイズの配列を制限なしの可変サイズ配列に変更します。

t = coder.typeof(ones(3,3))
t = coder.PrimitiveType 3×3 double
coder.resize(t,inf)
ans =编码器。PrimitiveType :inf×:inf double % ':' indicates variable-size dimensions

固定サイズの配列を制限付きの可変サイズ配列に変更します。

t = coder.typeof(ones(3,3))
t = coder.PrimitiveType 3×3 double
coder.resize(t,[4 5],1)
ans =编码器。PrimitiveType :4×:5 double % ':' indicates variable-size dimensions

構造体フィールドのサイズを変更します。

ts = coder.typeof(struct('a',ones(3, 3)))
ts = coder.StructType 1×1 struct a: 3×3 double
coder.resize(ts,[5, 5],'recursive',1)
ans =编码器。StructType 5×5 struct a: 5×5 double

cell 配列のサイズを変更します。

tc = coder.typeof({1 2 3})
tc = coder.CellType 1×3 homogeneous cell base: 1×1 double
coder.resize(tc,[5, 5],'recursive',1)
ans =编码器。CellType 5×5 homogeneous cell base: 1×1 double

制限付きおよび制限なしのしきい値に基づいて固定サイズ配列を可変サイズに変更します。

t = coder.typeof(ones(100,200))
t = coder.PrimitiveType 100×200 double
coder.resize(t,'sizelimits',[99 199])
ans =编码器。PrimitiveType: 100×:正%”:“我的两倍ndicates variable-size dimensions

入力引数

すべて折りたたむ

可変サイズのしきい値の行ベクトル。limitsの値がスカラーの場合、しきい値はスカラー拡張されます。tの次元のサイズszが最初のしきい値以上の場合、その次元は上限がszの可変サイズになります。tの次元のサイズszが 2 番目のしきい値以上の場合、その次元は制限なしの可変サイズになります。

例:coder.resize(t,'sizelimits',[99 199]);

データ型:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

coder.Typeオブジェクトt_outの新しいサイズ

例:coder.resize(t,[3,4]);

データ型:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

tcoder.CellTypeオブジェクトの場合,coder.CellTypeオブジェクトは同種でなければなりません。

例:coder.resize(t,inf);

データ型:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical|char|string|struct|table|cell|function_handle|categorical|datetime|duration|calendarDuration|fi
複素数のサポート:あり

t_outの各次元が固定サイズか可変サイズかを指定します。

例:coder.resize(t,[4 5],1);

データ型:logical

名前と値のペアの引数

オプションのコンマ区切りされたName,Valueの引数ペアを指定します。ここで、Nameは引数名、Valueは対応する値です。Nameは引用符で囲まなければなりません。Name1,Value1,...,NameN,ValueNのように、複数の名前と値のペアの引数を任意の順序で指定できます。

例:coder.resize(t,[5, 5],'recursive', 1);

recursivetrueに設定すると、tとこれに含まれるすべての型のサイズが変更されます。

データ型:logical

uniformtrueに設定すると、tのサイズが変更されますが、サイズが 1 の次元に対してはヒューリスティックな方法は適用されません。

データ型:logical

出力引数

すべて折りたたむ

サイズ変更されたcoder.Typeオブジェクト

データ型:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical|char|string|struct|table|cell|function_handle|categorical|datetime|duration|calendarDuration|fi
複素数のサポート:あり

制限

  • スパース行列の場合、coder.resizeは可変サイズの次元の上限を下げます。

R2011a で導入