Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

cordictanh

CORDIC ベースの双曲線正接

説明

T = cordictanh(theta)theta の双曲線正接を返します。

T = cordictanh(theta, niters) は CORDIC アルゴリズムの niters 反復を実行して theta の双曲線正接を返します。

すべて折りたたむ

既定の反復回数で CORDIC の実装を使用して fi オブジェクト theta の双曲線正接を求めます。

theta = fi(-2*pi:.1:2*pi-.1);
T_cordic = cordictanh(theta);

関数 tanh とその CORDIC 近似を使用して theta の双曲線正接をプロットします。

T = tanh(double(theta));
plot(theta, T_cordic);
hold on;
plot(theta, T);
legend('CORDIC approximation of tanh', 'tanh');
xlabel('theta');
ylabel('tanh(theta)');

Figure contains an axes object. The axes object with xlabel theta, ylabel tanh(theta) contains 2 objects of type line. These objects represent CORDIC approximation of tanh, tanh.

関数 cordictanh と関数 tanh の結果の差分を計算します。

figure;
err = abs(T - double(T_cordic));
plot(theta, err);
xlabel('theta');
ylabel('error');

Figure contains an axes object. The axes object with xlabel theta, ylabel error contains an object of type line.

CORDIC 実装を使用して fi オブジェクト theta の双曲線正接を求め、CORDIC カーネルで実行すべき反復回数を指定します。さまざまな反復回数で theta の双曲線正接の CORDIC 近似をプロットします。

theta = fi(-2*pi:.1:2*pi-.1);
for niters = 5:10:25
T_cordic = cordictanh(theta,niters);
plot(theta,T_cordic);
hold on;
end
xlabel('theta');
ylabel('tanh(theta)');
legend('5 iterations','15 iterations',...
    '25 iterations','Location','southeast');

Figure contains an axes object. The axes object with xlabel theta, ylabel tanh(theta) contains 3 objects of type line. These objects represent 5 iterations, 15 iterations, 25 iterations.

入力引数

すべて折りたたむ

ラジアン単位の角度の値。スカラー、ベクトル、行列または多次元配列として指定します。

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

CORDIC アルゴリズムを実行する反復回数。正の整数値スカラーとして指定します。niters を指定しない場合、アルゴリズムは既定値を使用します。固定小数点の入力では、niters の既定値は入力配列 theta の語長よりも 1 つ少なくなります。倍精度の入力では、niters の既定値は 52 です。単精度の入力では、既定値は 23 です。

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

出力引数

すべて折りたたむ

Ttheta の双曲線正接の CORDIC ベースの近似です。関数への入力が浮動小数点である場合、出力のデータ型は入力のデータ型と同じです。入力が固定小数点である場合、出力の語長は入力の語長と等しく、小数部の長さは WordLength2 と等しくなります。

拡張機能

バージョン履歴

R2017b で導入