Can I create a matrix with unknown dimension ?
1 回表示 (過去 30 日間)
古いコメントを表示
Can Matlab allow me to create a matrix that has an unknown dimension ? In case that the amount of data is unknown.
0 件のコメント
回答 (2 件)
Azzi Abdelmalek
2014 年 11 月 17 日
If you want to pre-allocate just set your matrix to
A=zeros(n,m)
nxm is the biggest dimension you are expecting
0 件のコメント
Adam
2014 年 11 月 17 日
編集済み: Adam
2014 年 11 月 17 日
Just working with a matrix in a normal way and using instructions that expand its size (ignoring the warnings you get) is the equivalent of creating a matrix of unknown size, but Azzi's solution above is usually preferable is you can put bounds on your "unexpectations"
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!