In MATLAB is there a way to define a variable say runningValue and push values onto it in succession an unknown number of times?
What I have been doing is something like this:
runningValue = 0; for j=1:length(someVector) ... runningValue(end+1) = (some value); ... endfor But this forces a leading 0. I know that after all is done I could just put j(1) = []; but I was wondering if there is a more elegant way to do this.
Note that the length of the runningValue variable is not a priori known; in particular, we are not populating length(someVector) elements, referring to the pseudocode above, and the j index is no of use.
runningValue = [];maybe for the initialization?