空行列の作成の利点
10 views (last 30 days)
Show older comments
よく参考書などで、事前割り当てなどをmatlabでは推奨していますが、変数に空の行列を事前割り当てしている参考書をよく見るのですが、これは一体なんのために割り当てているのでしょうか。
0 Comments
Answers (1)
Musashi Ito
on 1 Dec 2020
Edited: Musashi Ito
on 1 Dec 2020
2 Comments
Musashi Ito
on 4 Dec 2020
Edited: Musashi Ito
on 4 Dec 2020
プログラムの書き方にもよるかと思いますが、もしかしたら for 文の中で、データの抽出や連結などがあり、事前にデータのサイズが分からない。さらに、データの抽出条件によっては空の場合もあり、事前に空のデータを定義しないとデータ型のエラーが発生するようなプログラムのため、かもしれません・・・
See Also
Categories
Find more on ループと条件付きステートメント in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!