Dataset in Matlab -
i have large set of cross-sectional time series data in dataset in matlab , want extract arrays (columns) of data based on header given dynamically array in loop. can suggest how implement in matlab, have tried following code
cdslist = universe.bond; cdscount = length(universe.bond); i=1:cdscount cds = cdslist(i); % here want use variable cds dynamically give names dataset called spread, instance spread.cds cds changing in loop. end
is possible ? help
assuming cds
string, can used dynamic field name:
cdslist = universe.bond; cdscount = length(universe.bond); spread = struct; = 1:cdscount cds = cdslist{i}; spread.(cds) = data; end
Comments
Post a Comment