Hello everyone,
How Can I Pre allocate memory for a DATASET ARRAY which should have 274 Columns. There is another dataset array with the same columns in my workspace .The rows of the new dataset array differs every time the code run based on date. Can you help me with that?
Thanks, Vanessa

댓글 수: 2

KSSV
KSSV 2017년 4월 26일
The rows of the new dataset array differs every time the code run based on date whats the criteria here?
Vanessa
Vanessa 2017년 4월 26일
every hour new data are fetched from a database the number of them is not known so when the code run i cannot preallocate the size of array.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2017년 4월 26일

0 개 추천

You can follow something like this:
n = 10 ; % number of columns
A = zeros([],n); % rows not known
for ii = 1:100
A(ii,1:n) = rand(1,n);
end

댓글 수: 2

Vanessa
Vanessa 2017년 4월 26일
Thank u for your help!
KSSV
KSSV 2017년 4월 26일
thanking is accepting the answer.

댓글을 달려면 로그인하십시오.

질문:

2017년 4월 26일

댓글:

2017년 4월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by