Skip to content
  • Stéphane Adjemian's avatar
    New syntax for populating an empty dseries object. · 20041ac7
    Stéphane Adjemian authored
    If ts is an empty dseries object with a defined range of dates:
    
    ts = dseries(dates('1990Q1'):dates('1990Q4'));
    
    Then the following syntaxes are valid:
    
    1. ts(:) = 1;
    2. ts(:) = [1, 2];
    3. ts(:) = randn(4,1);
    4. ts(:) = dseries(1);
    5. ts(:) = dseries([1, 2]);
    6. ts(:) = dseries(randn(4,2));
    7. ts(:) = dseries(randn(4,2),dates('1950M1'):dates('1950M4'));
    
    Remarks.
    
    [1] In cases 1., 2., 4. and 5. the single observation is replicated to match the number of dates in ts.
    
    [2] In cases 4. to 7. the dates in the right member of the assignment are lost (ie ts.dates is not affected by the dates defined in the right members).
    20041ac7