Array Preallocation
Mostra commenti meno recenti
I am trying to preallocate an array that can be filled with any type of value string, double, int mostly. What am I doing wrong because I'm getting an error:
l = 300;
w = 13;
full_data=cell(l, w);
This is the error:
??? Subscripted assignment dimension mismatch.
Risposte (1)
Thomas
il 28 Mar 2012
your code works correctly and preallocates memory correctly
l = 300;
w = 13;
full_data=cell(l, w);
>> size(full_data)
ans =
300.00 13.00
Try clearing the variables before you begin.
doc clear
1 Commento
Matt Tearle
il 28 Mar 2012
Perhaps you have a variable called "cell"...?
Categorie
Scopri di più su Performance and Memory in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!