2012-12-17 matlabで矩形波を出力する方法 matlab t=0:0.1:pi() y=sign(sin(t)) plot(t,y) おわり。sign関数は、中身が正なら1を、負なら-1を出力します。