<< cellstr Elementary Functions delip >>

Scilab help >> Elementary Functions > char

char

char 関数

呼び出し手順

y=char( x)
y=char(st1,st2,st3,....)

パラメータ

x

文字列配列のセル, またはアスキーコードの配列

st1,st2,st3

文字列配列

y:

文字列(列)ベクトル

説明

入力引数が一つの場合 :

文字列配列xのセルを指定すると, この関数は 文字列セルの要素を行とする文字列ベクトル y を返します.

アスキーコードxの配列を指定すると, この関数はそのアスキーコードに対応する文字列の配列 y を返します. dims (x)=[n1,n2,n3,n4,....], は,2番目の dims 以外は入力値と同じ大きさの値, dims(y)=[n1,n3,n4,..] を返します.

入力引数が1より多い場合 :

文字列配列 st1,st2,st3,...を指定すると, この関数は, st1,st2,st3,...の要素が行となる 文字列のベクトルを返します. ベクトル y において, 文字列の長さ sti は空白で埋めることにより, stiの最長のものと同じ長さとする必要があります.

例

//Example with a hypermatrix of ascii codes :
x=hypermat([4,2,3],61:84);
y=char(x)
size(x)
size(y)

//Example with more than one argument :
st1="zeros";
st2=["one","two"];
st3=["three"];
y=char(st1,st2,st3)
size(y)

//all strings rows are completed by 'blanks' to have the same length : 6
length(y)

参照

作者

F.B

<< cellstr Elementary Functions delip >>