필터 지우기
필터 지우기

Can I create a matrix with unknown dimension ?

조회 수: 3 (최근 30일)
piggy_jes
piggy_jes 2014년 11월 17일
편집: Adam 2014년 11월 17일
Can Matlab allow me to create a matrix that has an unknown dimension ? In case that the amount of data is unknown.

답변 (2개)

Azzi Abdelmalek
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

Adam
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"

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by