adding data to dynamic field
Hi all,
I have written a for loop that creates new dynamic fields in
my existing data structure. It creates the first new field
fine but i can't seem to get data into it.
I want to initialize each of new array/field with zeros. DF
is a 647x1 structure.
length(DF)=647
dists=(20:20:200);
for iDists=1:length(dists)
binNum=strcat('bin',num2str(dists(iDists)));
DF.(binNum)=(zeros(length(DF));
end
and the error:
Insufficient outputs from right hand side to satisfy comma
separated list expansion on left hand side. Missing [] are
the most likely cause.
Where to put the []? I've tried them just about everywhere!
Thanks.
Jeff
.
Relevant Pages
- Re: adding data to dynamic field
... I have written a for loop that creates new dynamic fields in ... Missing are ... This seems like a strange data structure. ... (comp.soft-sys.matlab) - Re: Performance Improvement of complex data structure (hash of hashes of hashes)
... Anno Siegel wrote: ... >> Here is the code that I'm using to build up this data structure. ... loop through and increment the ... I know that memory allocation in C is expensive, ... (comp.lang.perl.misc) - Re: Proposed change to BC iterator parameters
... > loop through the elements of a data structure, ... provide everything viewed as an array. ... Some_Structure package provided an iterator. ... (comp.lang.ada) - Re: Modula-2 vs. Oberon-2
... Your observations serve to demonstrate that it is unwise to attempt to design a data structure with an incomplete specification of its requirements and without knowing what operations are required to be performed on that data structure. ... If you have the choice between developing an application in Modula-2 or Oberon-2 it is highly likely that the design of the data structures will be very different as, despite the superficial similarities, the capabilities of each language are very different. ... While it is always possible to implement a Modula-2 FOR loop as a WHILE loop the converse is NOT true. ... (comp.lang.modula2) - Re: concatenate variables during looping question
... > Trying to create a loop and need some help ... What you really need is a better choice of data structure. ... Sequentially-named variables are a red flag that an array would ... What you are attempting to do is use something called a "symbolic reference". ... (comp.lang.perl.misc) |
|