Matlabのabs、double、char関数
Matlabs Abs Double
1.機能機能:
Abs関数:実数の絶対値、複素数のモジュラス、および文字列のASCII値を検索します
二重関数:文字列のASCII値を取得します
Char関数:ASCII値を文字列に変換します。
2.コード例:
clc clear all a = -4 b = 1+2i abs(a)% find the absolute value of a real number abs(b)% find the modulus of a complex number c = 'MATLAB' d = abs(c)% converts a string into a matrix of ASCII values the double function has the same effect %d = double(c) char(d+32)% converts the ASCII value matrix into a string
演算結果:
年=
4
年=
2.2361
d =77 65 84 76 65 66
年=matlab