Create empty dataset array

4 vues (au cours des 30 derniers jours)
Vanessa
Vanessa le 26 Avr 2017
Commenté : KSSV le 26 Avr 2017
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 commentaires
KSSV
KSSV le 26 Avr 2017
The rows of the new dataset array differs every time the code run based on date whats the criteria here?
Vanessa
Vanessa le 26 Avr 2017
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.

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 26 Avr 2017
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 commentaires
Vanessa
Vanessa le 26 Avr 2017
Thank u for your help!
KSSV
KSSV le 26 Avr 2017
thanking is accepting the answer.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by