From 113314b0881beb6e3a11f567b683bf4db5775f51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 21 Sep 2017 22:50:32 +0200
Subject: [PATCH] Fixed bug. Missing ops and tags members when extracting
 variables.

---
 src/@dseries/subsref.m | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/@dseries/subsref.m b/src/@dseries/subsref.m
index fac7095..9f6f47f 100644
--- a/src/@dseries/subsref.m
+++ b/src/@dseries/subsref.m
@@ -225,6 +225,8 @@ switch S(1).type
         B.name = A.name;
         B.tex  = A.tex;
         B.dates = A.dates(tdx);
+        B.ops = A.ops;
+        B.tags = A.tags;
     elseif isvector(S(1).subs{1}) && all(isint(S(1).subs{1}))
         error('dseries::subsref: It is not possible to select observations with a vector of integers. You have to index with a dates object instead!');
     else
@@ -243,6 +245,11 @@ switch S(1).type
         B.name = A.name(idx);
         B.tex  = A.tex(idx);
         B.dates = A.dates;
+        B.ops = A.ops(idx);
+        tagnames = fieldnames(A.tags);
+        for i=1:length(tagnames)
+            B.tags.(tagnames{i}) = A.tags.(tagnames{i})(idx);
+        end
     else
         error('dseries::subsref: What the Hell are you tryin'' to do?!')
     end
-- 
GitLab