Scilab/ones のバックアップの現在との差分(No.1)


Scilab
ones1を並べる

使い方

ones(x) ……xと同じ形の1で満たされたベクトル・行列を返す。
ones(m,n) ……1で満たされたm×n行列を返す
ones(m1,m2,m3,……,mn) ……m1×m2×m3×……×mnのn階を返す。

例1


x = [1;2;3];

y = ones(x);

とすると、yは
1. 
1. 
1. 

となる。
ones1.png

例2


y = ones(3,2);

とすると、yは
1. 1. 
1. 1. 
1. 1. 
ones2.png

例3

ones3.png