0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Praat scriptの小ネタです。

空のvectorを作成しようとした場合、通常のリテラルの記法で書くとシンタックスエラーになってしまいます。

# 以下はエラーになる(symbol misplaced)
v# = {}

代わりに、ゼロ埋めされたvectorを生成する関数 zero# を使用することで作成できました。

# zero#: 全要素0のvectorを生成
# 引数に長さを指定可能なため、以下で長さ0 = 空のvectorが返ってくる
v# = zero#(0)

appendInfoLine(size(v#)) ; 0

(※ちなみに、zero# の本来の使い方は以下のように0埋めされたvectorの生成です)

# 長さ3のvector
appendInfoLine(zero#(3))
0 0 0
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?