diff --git a/matlab/@dseries/abs.m b/matlab/@dseries/abs.m
index 72a9520ce73bbe21ed373cc716d9fc842ec836da..ba4da3faba03f57f264ab76525020259b29e9373 100644
--- a/matlab/@dseries/abs.m
+++ b/matlab/@dseries/abs.m
@@ -40,16 +40,15 @@ function A = abs(B) % --*-- Unitary tests --*--
 
 A = dseries();
 
-A.nobs = B.nobs;
-A.vobs = B.vobs;
+A.data = abs(B.data);
 A.dates = B.dates;
-A.name = cell(A.vobs,1);
-A.tex = cell(A.vobs,1);
-for i = 1:A.vobs
+
+A.name = cell(vobs(A), 1);
+A.tex = cell(vobs(A), 1);
+for i = 1:vobs(A)
     A.name(i) = {[ 'abs(' B.name{i} ')']};
     A.tex(i) = {[ '|' B.tex{i} '|']};
 end
-A.data = abs(B.data);
 
 %@test:1
 %$ % Define a datasets.
diff --git a/matlab/@dseries/align.m b/matlab/@dseries/align.m
index e785e081d0cb16d91caa45d7e1a916a98d41cf60..32878127ec1631bb97778a330544bc569086d3e0 100644
--- a/matlab/@dseries/align.m
+++ b/matlab/@dseries/align.m
@@ -62,32 +62,28 @@ b_last = last;
 
 if firstdate(b)>init
     n = firstdate(b)-init;
-    b.data = [NaN(n,b.vobs); b.data];
-    b.nobs = b.nobs+n;
+    b.data = [NaN(n, vobs(b)); b.data];
     b_init = init;
 end
 
 if firstdate(a)>init
     n = firstdate(a)-init;
-    a.data = [NaN(n,a.vobs); a.data];
-    a.nobs = a.nobs+n;
+    a.data = [NaN(n, vobs(a)); a.data];
     a_init = init;
 end
 
 if lastdate(b)<last
     n = last-lastdate(b);
-    b.data = [b.data; NaN(n,b.vobs)];
-    b.nobs = b.nobs+n;
+    b.data = [b.data; NaN(n, vobs(b))];
 end
 
 if lastdate(a)<last
     n = last-lastdate(a);
-    a.data = [a.data; NaN(n,a.vobs)];
-    a.nobs = a.nobs+n;
+    a.data = [a.data; NaN(n, vobs(a))];
 end
 
-a.dates = a_init:a_init+(a.nobs-1);
-b.dates = b_init:b_init+(b.nobs-1);
+a.dates = a_init:a_init+(nobs(a)-1);
+b.dates = b_init:b_init+(nobs(b)-1);
 
 %@test:1
 %$ % Define a datasets.
diff --git a/matlab/@dseries/baxter_king_filter.m b/matlab/@dseries/baxter_king_filter.m
index d019e38c72b4f286d453c74ae494725ce918477f..1943668310ea1f8f89bab4ed1bc0151828db8376 100644
--- a/matlab/@dseries/baxter_king_filter.m
+++ b/matlab/@dseries/baxter_king_filter.m
@@ -87,15 +87,14 @@ weights = [flipud(weights(2:K+1)); weights];
 tmp = zeros(size(ts.data));
 
 % Filtering step.
-for t = K+1:ts.nobs-K
+for t = K+1:nobs(ts)-K
     tmp(t,:)  = weights'*ts.data(t-K:t+K,:);    
 end
 
 % Update dseries object.
 ts.data = tmp(K+1:end-K,:);
-ts.nobs = ts.nobs-2*K;
 init = firstdate(ts)+K;
-ts.dates = init:init+(ts.nobs-1);
+ts.dates = init:init+(nobs(ts)-1);
 
 %@test:1
 %$ plot_flag = 0;
diff --git a/matlab/@dseries/chain.m b/matlab/@dseries/chain.m
index 2c261758edb72ce3ecf9701cac0b488db5164f42..fae59f0523d92f84feb1bdbe1749d39150f9d41c 100644
--- a/matlab/@dseries/chain.m
+++ b/matlab/@dseries/chain.m
@@ -17,7 +17,7 @@ function vs = chain(ts,us)  % --*-- Unitary tests --*--
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-if ts.vobs-us.vobs
+if vobs(ts)-vobs(us)
     error(['dseries::chain: dseries objects ' inputname(1) ' and ' inputname(2) ' must have the same number of variables!'])
 end
 
@@ -35,9 +35,8 @@ CumulatedGrowthFactors = cumprod(GrowthFactor);
 
 vs = ts;
 vs.data = [vs.data; bsxfun(@times,CumulatedGrowthFactors,vs.data(end,:))];
-vs.nobs = rows(vs.data);
 
-vs.dates = firstdate(vs):firstdate(vs)+vs.nobs;
+vs.dates = firstdate(vs):firstdate(vs)+nobs(vs);
 
 %@test:1
 %$ try
diff --git a/matlab/@dseries/check.m b/matlab/@dseries/check.m
index a190b0dccd6ec8a1ccd392ebd92157764b672ad0..c4bfce37a40008176eaed90794a31e953cfa01f6 100644
--- a/matlab/@dseries/check.m
+++ b/matlab/@dseries/check.m
@@ -21,7 +21,7 @@ error_flag = 0;
 
 [n,m] = size(A.data);
 
-if ~isequal(m,A.vobs);
+if ~isequal(m, vobs(A));
     error_flag = 1;
     if nargout>1
         message = ['dseries: Wrong number of variables in dseries object ''' inputname(1) '''!'];
@@ -29,7 +29,7 @@ if ~isequal(m,A.vobs);
     return
 end
 
-if ~isequal(n,A.nobs);
+if ~isequal(n,nobs(A));
     error_flag = 1;
     if nargout>1
         message = ['dseries: Wrong number of observations in dseries object ''' inputname(1) '''!'];
@@ -77,7 +77,7 @@ if ~isequal(numel(unique(A.tex)),numel(A.tex));
     return
 end
 
-if ~isequal(A.dates,firstdate(A):firstdate(A)+A.nobs)
+if ~isequal(A.dates,firstdate(A):firstdate(A)+nobs(A))
     error_flag = 1;
     if nargout>1
         message = ['dseries: Wrong definition of the dates member in dseries object ''' inputname(1) '''!'];
diff --git a/matlab/@dseries/cumprod.m b/matlab/@dseries/cumprod.m
index 35ed8275edb94848b9d02933c7f395fc2b61eba3..4e98d38b1ad3ca6177e80cfa19baa3d5a263b515 100644
--- a/matlab/@dseries/cumprod.m
+++ b/matlab/@dseries/cumprod.m
@@ -34,7 +34,7 @@ if isempty(idx)
     error('dseries::cumprod: All the variables have NaNs. The cumulated product cannot be computed!')
 end
 
-if ~isequal(idx(:),transpose(1:varargin{1}.vobs))
+if ~isequal(idx(:),transpose(1:vobs(varargin{1})))
     warning('dseries::cumprod: The cumulated product is not computed for some variables because they have NaNs!')
 end
 
@@ -45,19 +45,19 @@ switch nargin
       % Perform the cumulated sum
       B.data(:,idx) = cumprod(B.data(:,idx));
       % Change the name of the variables
-      for i=1:B.vobs
+      for i=1:vobs(B)
           B.name(i) = {['cumprod(' B.name{i} ')']};
           B.tex(i) = {['\prod_t ' B.tex{i}]};
       end
   case 2
     if isdseries(varargin{2})
-        if ~isequal(varargin{1}.vobs, varargin{2}.vobs)
+        if ~isequal(vobs(varargin{1}), vobs(varargin{2}))
             error('dseries::cumprod: First and second input arguments must be dseries objects with the same number of variables!')
         end
         if ~isequal(varargin{1}.name, varargin{2}.name)
             warning('dseries::cumprod: First and second input arguments must be dseries objects do not have the same variables!')
         end
-        if ~isequal(varargin{2}.nobs,1)
+        if ~isequal(nobs(varargin{2}),1)
             error('dseries::cumprod: Second input argument must be a dseries object with only one observation!')
         end
         B = cumprod(varargin{1});
@@ -84,13 +84,13 @@ switch nargin
     if ~isdseries(varargin{3})
         error('dseries::cumprod: Third input argument must be a dseries object!')
     end
-    if ~isequal(varargin{1}.vobs, varargin{3}.vobs)
+    if ~isequal(vobs(varargin{1}), vobs(varargin{3}))
         error('dseries::cumprod: First and third input arguments must be dseries objects with the same number of variables!')
     end
     if ~isequal(varargin{1}.name, varargin{3}.name)
         warning('dseries::cumprod: First and third input arguments must be dseries objects do not have the same variables!')
     end
-    if ~isequal(varargin{3}.nobs,1)
+    if ~isequal(nobs(varargin{3}),1)
         error('dseries::cumprod: Third input argument must be a dseries object with only one observation!')
     end
     B = cumprod(varargin{1});
diff --git a/matlab/@dseries/cumsum.m b/matlab/@dseries/cumsum.m
index 4c082c4ba9c8ef5354993ed06c73820788a357ba..6dfb73c284dfd166d59b91cb08e2f375dc306b42 100644
--- a/matlab/@dseries/cumsum.m
+++ b/matlab/@dseries/cumsum.m
@@ -34,7 +34,7 @@ if isempty(idx)
     error('dseries::cumsum: All the variables have NaNs. The cumulated sum cannot be computed!')
 end
 
-if ~isequal(idx(:),transpose(1:varargin{1}.vobs))
+if ~isequal(idx(:),transpose(1:vobs(varargin{1})))
     warning('dseries::cumsum: The cumulated sum is not computed for some variables because they have NaNs!')
 end
 
@@ -45,19 +45,19 @@ switch nargin
       % Perform the cumulated sum
       B.data(:,idx) = cumsum(B.data(:,idx));
       % Change the name of the variables
-      for i=1:B.vobs
+      for i=1:vobs(B)
           B.name(i) = {['cumsum(' B.name{i} ')']};
           B.tex(i) = {['\sum_t ' B.tex{i}]};
       end
   case 2
     if isdseries(varargin{2})
-        if ~isequal(varargin{1}.vobs, varargin{2}.vobs)
+        if ~isequal(vobs(varargin{1}), vobs(varargin{2}))
             error('dseries::cumsum: First and second input arguments must be dseries objects with the same number of variables!')
         end
         if ~isequal(varargin{1}.name, varargin{2}.name)
             warning('dseries::cumsum: First and second input arguments must be dseries objects do not have the same variables!')
         end
-        if ~isequal(varargin{2}.nobs,1)
+        if ~isequal(nobs(varargin{2}),1)
             error('dseries::cumsum: Second input argument must be a dseries object with only one observation!')
         end
         B = cumsum(varargin{1});
@@ -83,13 +83,13 @@ switch nargin
     if ~isdseries(varargin{3})
         error('dseries::cumsum: Third input argument must be a dseries object!')
     end
-    if ~isequal(varargin{1}.vobs, varargin{3}.vobs)
+    if ~isequal(vobs(varargin{1}), vobs(varargin{3}))
         error('dseries::cumsum: First and third input arguments must be dseries objects with the same number of variables!')
     end
     if ~isequal(varargin{1}.name, varargin{3}.name)
         warning('dseries::cumsum: First and third input arguments must be dseries objects do not have the same variables!')
     end
-    if ~isequal(varargin{3}.nobs,1)
+    if ~isequal(nobs(varargin{3}),1)
         error('dseries::cumsum: Third input argument must be a dseries object with only one observation!')
     end
     B = cumsum(varargin{1});
diff --git a/matlab/@dseries/detrend.m b/matlab/@dseries/detrend.m
index 04f8b023a3ed4e1bfcff5cd58b71fb89011a0336..fa6a193f102c93a7593cfb475f663b58483fa063 100644
--- a/matlab/@dseries/detrend.m
+++ b/matlab/@dseries/detrend.m
@@ -30,9 +30,9 @@ if isnumeric(model)
           case 0
             data = demean(data);
           otherwise
-            x = NaN(o.nobs, model+1);
-            x(:,1) = ones(o.nobs, 1);
-            x(:,2) = transpose(1:o.nobs);
+            x = NaN(nobs(o), model+1);
+            x(:,1) = ones(nobs(o), 1);
+            x(:,2) = transpose(1:nobs(o));
             for c=3:model+1
                 x(:,c) = x(:,c-1).*x(:,2);
             end
diff --git a/matlab/@dseries/disp.m b/matlab/@dseries/disp.m
index 4ea14a7e65b26da68dfa09f93c38928f98266252..5bd38f464e997b25ec3fdc661bff2a2900096b19 100644
--- a/matlab/@dseries/disp.m
+++ b/matlab/@dseries/disp.m
@@ -19,16 +19,16 @@ function disp(A)
 %! @end deftypefn
 %@eod:
 
-separator = repmat(' | ',A.nobs+1,1);
+separator = repmat(' | ', nobs(A)+1,1);
 vspace = ' ';
 TABLE = ' ';
-for t=1:A.nobs
+for t=1:nobs(A)
     TABLE = char(TABLE, date2string(A.dates(t)));
 end
-for i = 1:A.vobs
+for i = 1:vobs(A)
     TABLE = horzcat(TABLE,separator);
     tmp = A.name{i};
-    for t=1:A.nobs
+    for t=1:nobs(A)
         tmp = char(tmp,num2str(A.data(t,i)));
     end
     TABLE = horzcat(TABLE, tmp);
diff --git a/matlab/@dseries/display.m b/matlab/@dseries/display.m
index 70998ecd89c94ad247011577f05ae6c8d23a3678..d6826a801354b943a64438e15e15982629873f37 100644
--- a/matlab/@dseries/display.m
+++ b/matlab/@dseries/display.m
@@ -21,16 +21,16 @@ function display(A)
 vspace = ' ';
 TABLE = ' ';
 
-if A.vobs<=10
-    if A.nobs<=40
-        separator = repmat(' | ',A.nobs+1,1);
-        for t=1:A.nobs
+if vobs(A)<=10
+    if nobs(A)<=40
+        separator = repmat(' | ', nobs(A)+1,1);
+        for t=1:nobs(A)
             TABLE = char(TABLE, date2string(A.dates(t)));
         end
-        for i = 1:A.vobs
+        for i = 1:vobs(A)
             TABLE = horzcat(TABLE,separator);
             tmp = A.name{i};
-            for t=1:A.nobs
+            for t=1:nobs(A)
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             TABLE = horzcat(TABLE, tmp);
@@ -42,17 +42,17 @@ if A.vobs<=10
             TABLE = char(TABLE, date2string(A.dates(t)));
         end
         TABLE = char(TABLE,vspace);
-        for t = A.nobs-n:A.nobs
+        for t = nobs(A)-n:nobs(A)
             TABLE = char(TABLE, date2string(A.dates(t)));
         end
-        for i=1:A.vobs
+        for i=1:vobs(A)
             TABLE = horzcat(TABLE,separator);
             tmp = A.name{i};
             for t=1:10
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             tmp = char(tmp,vspace);
-            for t=A.nobs-10:A.nobs
+            for t=nobs(A)-10:nobs(A)
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             TABLE = horzcat(TABLE, tmp);
@@ -60,24 +60,24 @@ if A.vobs<=10
     end
 else
     m = 4;
-    if A.nobs<=40
-        separator = repmat(' | ',A.nobs+1,1);
-        for t=1:A.nobs
+    if nobs(A)<=40
+        separator = repmat(' | ', nobs(A)+1,1);
+        for t=1:nobs(A)
             TABLE = char(TABLE, date2string(A.dates(t)));
         end
         for i = 1:m
             TABLE = horzcat(TABLE,separator);
             tmp = A.name{i};
-            for t=1:A.nobs
+            for t=1:nobs(A)
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             TABLE = horzcat(TABLE, tmp);
         end
-        TABLE = horzcat(TABLE, separator, repmat(' ... ', A.nobs+1,1));
-        for i = A.vobs-m+1:A.vobs
+        TABLE = horzcat(TABLE, separator, repmat(' ... ', nobs(A)+1,1));
+        for i = vobs(A)-m+1:vobs(A)
             TABLE = horzcat(TABLE,separator);
             tmp = A.name{i};
-            for t=1:A.nobs
+            for t=1:nobs(A)
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             TABLE = horzcat(TABLE, tmp);
@@ -89,7 +89,7 @@ else
             TABLE = char(TABLE, date2string(A.dates(t)));
         end
         TABLE = char(TABLE,vspace);
-        for t = A.nobs-n:A.nobs
+        for t = nobs(A)-n:nobs(A)
             TABLE = char(TABLE, date2string(A.dates(t)));
         end
         for i=1:m
@@ -99,20 +99,20 @@ else
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             tmp = char(tmp,vspace);
-            for t=A.nobs-10:A.nobs
+            for t=nobs(A)-10:nobs(A)
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             TABLE = horzcat(TABLE, tmp);
         end
         TABLE = horzcat(TABLE, separator, repmat(' ... ', 2*n+3,1));
-        for i=A.vobs-m+1:A.vobs
+        for i=vobs(A)-m+1:vobs(A)
             TABLE = horzcat(TABLE,separator);
             tmp = A.name{i};
             for t=1:10
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             tmp = char(tmp,vspace);
-            for t=A.nobs-10:A.nobs
+            for t=nobs(A)-10:nobs(A)
                 tmp = char(tmp,num2str(A.data(t,i)));
             end
             TABLE = horzcat(TABLE, tmp);
diff --git a/matlab/@dseries/dseries.m b/matlab/@dseries/dseries.m
index bd5273a1de1d859649b0f771d81a1a05346ee60f..7fadb4c4332c3081772579b5239330a8daf64b48 100644
--- a/matlab/@dseries/dseries.m
+++ b/matlab/@dseries/dseries.m
@@ -79,8 +79,6 @@ function ts = dseries(varargin) % --*-- Unitary tests --*--
 if nargin>0 && ischar(varargin{1}) && isequal(varargin{1},'initialize')
     ts = struct;
     ts.data  = [];
-    ts.nobs  = 0;
-    ts.vobs  = 0;
     ts.name  = {};
     ts.tex   = {};
     ts.dates = dates();
@@ -137,9 +135,7 @@ switch nargin
         end
         ts.data = data;
         ts.name = varlist;
-        ts.vobs = length(varlist);
-        ts.nobs = size(data,1);
-        ts.dates = init:init+(ts.nobs-1);
+        ts.dates = init:init+(nobs(ts)-1);
         if isempty(tex)
             ts.tex = name2tex(varlist);
         else
@@ -147,10 +143,9 @@ switch nargin
         end
     elseif isnumeric(varargin{1}) && isequal(ndims(varargin{1}),2)
         ts.data = varargin{1};
-        [ts.nobs, ts.vobs] = size(ts.data);
-        ts.name = default_name(ts.vobs);
+        ts.name = default_name(vobs(ts));
         ts.tex = name2tex(ts.name);
-        ts.dates = dates(1,1):dates(1,1)+(ts.nobs-1);
+        ts.dates = dates(1,1):dates(1,1)+(nobs(ts)-1);
     end
   case {2,3,4}
     if isequal(nargin,2) && ischar(varargin{1}) && isdates(varargin{2})
@@ -185,29 +180,26 @@ switch nargin
     end
     % Get data, number of observations and number of variables.
     ts.data = a;
-    ts.nobs = size(a,1);
-    ts.vobs = size(a,2);
     % Get the first date and set the frequency.
     if isempty(b)
         init = dates(1,1);
     elseif (isdates(b) && isequal(length(b),1))
         init = b;
-    elseif isdate(b)% Weekly, Monthly, Quaterly or Annual data (string).
+    elseif ischar(b) && isdate(b)% Weekly, Monthly, Quaterly or Annual data (string).
         init = dates(b);
     elseif (isnumeric(b) && isscalar(b) && isint(b)) % Yearly data.
         init = dates([num2str(b) 'Y']);
     elseif isdates(b) % Range of dates
         init = b(1);
-        if ts.nobs>1 && ~isequal(b.ndat,ts.nobs)
+        if nobs(ts)>1 && ~isequal(b.ndat,nobs(ts))
             message =   'dseries::dseries: If second input is a range, its number of elements must match ';
             message = char(message, '                  the number of rows in the first input, unless the first input');
             message = char(message, '                  has only one row.');
             skipline()
             disp(message);
             error(' ');
-        elseif isequal(ts.nobs, 1)
+        elseif isequal(nobs(ts), 1)
             ts.data = repmat(ts.data,b.ndat,1);
-            ts.nobs = b.ndat;
         end
         ts.dates = b;
     elseif (isnumeric(b) && isint(b)) % Range of yearly dates.
@@ -220,19 +212,19 @@ switch nargin
     end
     % Get the names of the variables.
     if ~isempty(c)
-        if ts.vobs==length(c)
-            for i=1:ts.vobs
+        if vobs(ts)==length(c)
+            for i=1:vobs(ts)
                 ts.name = vertcat(ts.name, c(i));
             end
         else
             error('dseries::dseries: The number of declared names does not match the number of variables!')
         end
     else
-        ts.name = default_name(ts.vobs);
+        ts.name = default_name(vobs(ts));
     end
     if ~isempty(d)
-        if ts.vobs==length(d)
-            for i=1:ts.vobs
+        if vobs(ts)==length(d)
+            for i=1:vobs(ts)
                 ts.tex = vertcat(ts.tex, d(i));
             end
         else
@@ -246,7 +238,7 @@ switch nargin
 end
 
 if isempty(ts.dates)
-    ts.dates = init:init+(ts.nobs-1);
+    ts.dates = init:init+(nobs(ts)-1);
 end
 
 %@test:1
@@ -349,12 +341,12 @@ end
 %@test:6
 %$ t = zeros(8,1);
 %$
-%$ %try
+%$ try
 %$     ts = dseries(transpose(1:5),[]);
 %$     t(1) = 1;
-%$ %catch
-%$ %    t = 0;
-%$ %end
+%$ catch
+%$     t = 0;
+%$ end
 %$
 %$ if length(t)>1
 %$     t(2) = dyn_assert(ts.freq,1);
diff --git a/matlab/@dseries/end.m b/matlab/@dseries/end.m
index a908692883b81c7df3a1077222a140b9a32277d3..8f60971367a15c179134630fbabde65724df11c6 100644
--- a/matlab/@dseries/end.m
+++ b/matlab/@dseries/end.m
@@ -18,4 +18,4 @@ function lastIndex = end(o, k, n)
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
 assert(k==1 && n==1, 'dseries::end: Wrong indexing!');
-lastIndex = o.vobs;
\ No newline at end of file
+lastIndex = vobs(o);
\ No newline at end of file
diff --git a/matlab/@dseries/eq.m b/matlab/@dseries/eq.m
index 7dcd86b2a4ba0e8af774474cef52235478ed8d60..7664cb094a2bbb221c10d1ce09e8ac01a81f65d0 100644
--- a/matlab/@dseries/eq.m
+++ b/matlab/@dseries/eq.m
@@ -37,13 +37,13 @@ if ~(isdseries(A) && isdseries(B))
     error('dseries::eq: Both input arguments must be dseries objects!')
 end
 
-if ~isequal(A.nobs,B.nobs)
+if ~isequal(nobs(A), nobs(B))
     warning('dseries::eq: Both input arguments should have the same number of observations!')
     C = 0;
     return
 end
 
-if ~isequal(A.vobs,B.vobs)
+if ~isequal(vobs(A), vobs(B))
     warning('dseries::eq: Both input arguments should have the same number of observations!')
     C = 0;
     return
diff --git a/matlab/@dseries/exp.m b/matlab/@dseries/exp.m
index 4fa36bc793433ca52c46b2c56e3a0de7b835552c..06ed6a1f03291cb11d51ea5fcd35855c87987cab 100644
--- a/matlab/@dseries/exp.m
+++ b/matlab/@dseries/exp.m
@@ -46,7 +46,7 @@ function ts = exp(ts)
 
 ts.data = exp(ts.data);
 
-for i=1:ts.vobs
+for i=1:vobs(ts)
     ts.name(i) = {['exp(' ts.name{i} ')']};
     ts.tex(i) = {['\exp(' ts.tex{i} ')']};
 end
\ No newline at end of file
diff --git a/matlab/@dseries/extract.m b/matlab/@dseries/extract.m
index 2d61a0b95767f20337a7e91350e851d5322e09d0..c280115ee4f4e515f62a21ce189251816468cfa8 100644
--- a/matlab/@dseries/extract.m
+++ b/matlab/@dseries/extract.m
@@ -126,8 +126,6 @@ end
 
 A.data = B.data(:,idVariableName);
 A.dates = B.dates;
-A.nobs = B.nobs;
-A.vobs = length(idVariableName);
 A.name = B.name(idVariableName);
 A.tex = B.tex(idVariableName);
 
diff --git a/matlab/@dseries/horzcat.m b/matlab/@dseries/horzcat.m
index 5f05af87fb08f44aa013aeb11fd4806a9b700dcc..e4d9cbee7b7dc51235cbc23c074745e5f3dcac6b 100644
--- a/matlab/@dseries/horzcat.m
+++ b/matlab/@dseries/horzcat.m
@@ -68,41 +68,38 @@ function a = concatenate(b,c)
         a = dseries();
     end
     d_nobs_flag = 0;
-    if ~isequal(b.nobs,c.nobs)
+    if ~isequal(nobs(b),nobs(c))
         d_nobs_flag = 1;
-    else
-        a.nobs = b.nobs;
     end
     d_init_flag = 0;
     if ~isequal(firstdate(b),firstdate(c))
         d_init_flag = 1;
     end
-    a.vobs = b.vobs+c.vobs;
     a.name = vertcat(b.name,c.name);
     a.tex  = vertcat(b.tex,c.tex);
     if ~( d_nobs_flag(1) || d_init_flag(1) )
         a.data = [b.data,c.data];
         a.dates = b.dates;
     else
+        nobs_b = nobs(b);
+        nobs_c = nobs(c);
         if firstdate(b)<=firstdate(c)
             if firstdate(b)<firstdate(c)
-                c.data = [NaN(firstdate(c)-firstdate(b),c.vobs); c.data];
+                c.data = [NaN(firstdate(c)-firstdate(b), vobs(c)); c.data];
             end
         else
-            b_first_lines = firstdate(b)-firstdate(c);
-            b.data = [NaN(firstdate(b)-firstdate(c),b.vobs); b.data];
+            b.data = [NaN(firstdate(b)-firstdate(c), vobs(b)); b.data];
         end
-        b_last_date = firstdate(b)+b.nobs;
-        c_last_date = firstdate(c)+c.nobs;
+        b_last_date = firstdate(b)+nobs_b;
+        c_last_date = firstdate(c)+nobs_c;
         if b_last_date<c_last_date
-            b.data = [b.data; NaN(c_last_date-b_last_date,b.vobs)];
+            b.data = [b.data; NaN(c_last_date-b_last_date, vobs(b))];
         elseif b_last_date>c_last_date
-            c.data = [c.data; NaN(b_last_date-c_last_date,c.vobs)];
+            c.data = [c.data; NaN(b_last_date-c_last_date, vobs(c))];
         end
         a.data = [b.data, c.data];
         a.dates = unique([b.dates, c.dates]);
     end
-    a.nobs = size(a.data,1);
 
 %@test:1
 %$ % Define a data set.
diff --git a/matlab/@dseries/hpcycle.m b/matlab/@dseries/hpcycle.m
index a35abf7b661fac1f1f048d43ab6ca0f059512d18..ad1ec56fa389003b32d40d98e4336877d24781d6 100644
--- a/matlab/@dseries/hpcycle.m
+++ b/matlab/@dseries/hpcycle.m
@@ -36,7 +36,7 @@ else
     lambda = [];
 end 
 
-for i=1:ts.vobs
+for i=1:vobs(ts)
     ts.name(i) = {['hpcycle(' ts.name{i} ')']};
     ts.tex(i) = {['\text{hpcycle}(' ts.tex{i} ')']};
 end
diff --git a/matlab/@dseries/hptrend.m b/matlab/@dseries/hptrend.m
index a8e1366b7e21bd4503629761582f55826ad9acaa..754b3212a430b2961ab04328d07900300ef1688f 100644
--- a/matlab/@dseries/hptrend.m
+++ b/matlab/@dseries/hptrend.m
@@ -36,7 +36,7 @@ else
     lambda = [];
 end
 
-for i=1:ts.vobs
+for i=1:vobs(ts)
     ts.name(i) = {['hptrend(' ts.name{i} ')']};
     ts.tex(i) = {['\text{hptrend}(' ts.tex{i} ')']};
 end
diff --git a/matlab/@dseries/insert.m b/matlab/@dseries/insert.m
index 128c72dff5a32be4aabe6cde6234e9c9e3a24f8e..e1550861413540b531fe78123329f95e06a77008 100644
--- a/matlab/@dseries/insert.m
+++ b/matlab/@dseries/insert.m
@@ -74,11 +74,6 @@ for i=1:n
     id = id+1;
 end
 
-% Update vobs member.
-ts.vobs = columns(ts.data);
-
-
-
 %@test:1
 %$ % Define a datasets.
 %$ A = rand(10,3); B = rand(5,2);
diff --git a/matlab/@dseries/isempty.m b/matlab/@dseries/isempty.m
index f171be29545d49d6a2c71a6290616f4b6d5a0e97..5df634e46ee8ab8a70499adf1b3d79950c281f98 100644
--- a/matlab/@dseries/isempty.m
+++ b/matlab/@dseries/isempty.m
@@ -36,5 +36,5 @@ function b = isempty(A)
 %
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
-    
-b = isempty(A.data) && isequal(A.nobs,0) && isequal(A.vobs,0);
\ No newline at end of file
+
+b = isempty(A.data);
\ No newline at end of file
diff --git a/matlab/@dseries/isequal.m b/matlab/@dseries/isequal.m
index 003f6903cb32d181383304adfd70765150f056b7..d57150551ee819bb3931c83fbd62b311c01ed4f8 100644
--- a/matlab/@dseries/isequal.m
+++ b/matlab/@dseries/isequal.m
@@ -34,12 +34,12 @@ if ~isdseries(B)
     error('dseries::isequal: Both input arguments must be dseries objects!')
 end
 
-if ~isequal(A.nobs,B.nobs)
+if ~isequal(nobs(A), nobs(B))
     C = 0;
     return
 end
 
-if ~isequal(A.vobs,B.vobs)
+if ~isequal(vobs(A), vobs(B))
     C = 0;
     return
 end
diff --git a/matlab/@dseries/lag.m b/matlab/@dseries/lag.m
index d0ce3965d3bca27ef9f1aae39514c0de73ac3111..4a2069599b543033c096a8a2eb3ad11072e34396 100644
--- a/matlab/@dseries/lag.m
+++ b/matlab/@dseries/lag.m
@@ -52,9 +52,9 @@ end
 us = ts;
 
 % Update data member
-us.data = [NaN(p,ts.vobs);  ts.data(1:end-p,:)];
+us.data = [NaN(p, vobs(ts));  ts.data(1:end-p,:)];
 
-for i=1:ts.vobs
+for i=1:vobs(ts)
     us.name(i) = {[ 'lag(' ts.name{i} ',' int2str(p) ')']};
     us.tex(i) = {[ ts.tex{i} '_{-' int2str(p) '}']};
 end
diff --git a/matlab/@dseries/lead.m b/matlab/@dseries/lead.m
index 8a61e2d0c263b9c3ea0fd890285495ed8f9de16b..c4eba7a230226d87007943f673c4c8c93d790890 100644
--- a/matlab/@dseries/lead.m
+++ b/matlab/@dseries/lead.m
@@ -52,9 +52,9 @@ end
 us = ts;
 
 % Update data member
-us.data = [  ts.data(p+1:end,:); NaN(p,ts.vobs);];
+us.data = [  ts.data(p+1:end,:); NaN(p, vobs(ts));];
 
-for i=1:ts.vobs
+for i=1:vobs(ts)
     us.name(i) = {[ 'lead(' ts.name{i} ',' int2str(p) ')']};
     us.tex(i) = {[ ts.tex{i} '_{+' int2str(p) '}']};
 end
diff --git a/matlab/@dseries/log.m b/matlab/@dseries/log.m
index 6655fa29a19494b1e714123d9f5fd2fd4b0672f8..2ff8e6488572bc1bf7497ca771f996beb34a4962 100644
--- a/matlab/@dseries/log.m
+++ b/matlab/@dseries/log.m
@@ -47,7 +47,7 @@ if any(ts.data<eps)
     error('dseries::log: Input argument has to be strictly positive!')
 end
 
-for i=1:ts.vobs
+for i=1:vobs(ts)
     ts.name(i) = {['log(' ts.name{i} ')']};
     ts.tex(i) = {['\log(' ts.tex{i} ')']};
 end
diff --git a/matlab/@dseries/merge.m b/matlab/@dseries/merge.m
index 0f02ceea8b9aeada18fa26d803815047e5555132..1ab70b389299c6f5bd9daf114c0e26f58468f305 100644
--- a/matlab/@dseries/merge.m
+++ b/matlab/@dseries/merge.m
@@ -51,46 +51,45 @@ end
 A = dseries();
 [A.name, IBC, junk] = unique([B.name; C.name], 'last');
 tex = [B.tex; C.tex];
-A.tex = tex(IBC); 
-A.vobs=length(IBC);
+A.tex = tex(IBC);
 
-if B.nobs == 0
+if nobs(B) == 0
     A = C;
-elseif C.nobs == 0
+elseif nobs(C) == 0
     A = B;
 elseif firstdate(B) >= firstdate(C)
     diff = firstdate(B) - firstdate(C);
-    A.nobs = max(B.nobs + diff, C.nobs);
-    A.data = NaN(A.nobs, A.vobs);
-    Z1 = [NaN(diff,B.vobs);B.data];
-    if A.nobs > B.nobs + diff
-        Z1 = [Z1; NaN(A.nobs-(B.nobs + diff),B.vobs)];
+    A_nobs = max(nobs(B) + diff, nobs(C));
+    A.data = NaN(A_nobs, vobs(A));
+    Z1 = [NaN(diff, vobs(B));B.data];
+    if nobs(A) > nobs(B) + diff
+        Z1 = [Z1; NaN(nobs(A)-(nobs(B) + diff), vobs(B))];
     end;
     Z2 = C.data;
-    if A.nobs > C.nobs
-        Z2 = [Z2; NaN(A.nobs - C.nobs,C.vobs)];
+    if nobs(A) > nobs(C)
+        Z2 = [Z2; NaN(nobs(A) - nobs(C), vobs(C))];
     end;
     Z = [Z1 Z2];
     A.data = Z(:,IBC);
     A_init = firstdate(C);
 else
     diff = firstdate(C) - firstdate(B);
-    A.nobs = max(C.nobs + diff, B.nobs);
-    A.data = NaN(A.nobs, A.vobs);
-    Z1 = [NaN(diff,C.vobs);C.data];
-    if A.nobs > C.nobs + diff
-        Z1 = [Z1; NaN(A.nobs-(C.nobs + diff),C.vobs)];
-    end;
+    A_nobs = max(nobs(C) + diff, nobs(B));
+    A.data = NaN(A_nobs, vobs(A));
+    Z1 = [NaN(diff, vobs(C)); C.data];
+    if nobs(A) > nobs(C) + diff
+        Z1 = [Z1; NaN(nobs(A)-(nobs(C) + diff), vobs(C))];
+    end
     Z2 = B.data;
-    if A.nobs > B.nobs 
-        Z2 = [Z2; NaN(A.nobs - B.nobs,B.vobs)];
+    if nobs(A) > nobs(B)
+        Z2 = [Z2; NaN(nobs(A) - nobs(B), vobs(B))];
     end;
     Z = [Z2 Z1];
     A.data = Z(:,IBC);
     A_init = B.init;
 end
 
-A.dates = A_init:A_init+(A.nobs-1);
+A.dates = A_init:A_init+(nobs(A)-1);
 
 %@test:1
 %$ % Define a datasets.
diff --git a/matlab/@dseries/minus.m b/matlab/@dseries/minus.m
index ec9bf419a3386e96db0933e91fba15eb00c6a72e..a6b6f91e477285da4c5da9c7164cb9e38f86e8af 100644
--- a/matlab/@dseries/minus.m
+++ b/matlab/@dseries/minus.m
@@ -58,18 +58,18 @@ if isnumeric(C) && (isscalar(C) || isvector(C))
     return
 end
 
-if ~isequal(B.vobs,C.vobs) && ~(isequal(B.vobs,1) || isequal(C.vobs,1))
+if ~isequal(vobs(B), vobs(C)) && ~(isequal(vobs(B),1) || isequal(vobs(C),1))
     error(['dseries::minus: Cannot substract ' inputname(1) ' and ' inputname(2) ' (wrong number of variables)!'])
 else
-    if B.vobs>C.vobs
-        idB = 1:B.vobs;
-        idC = ones(1:B.vobs);
-    elseif B.vobs<C.vobs
-        idB = ones(1,C.vobs);
-        idC = 1:C.vobs;
+    if vobs(B)>vobs(C)
+        idB = 1:vobs(B);
+        idC = ones(1:vobs(B));
+    elseif vobs(B)<vobs(C)
+        idB = ones(1,vobs(C));
+        idC = 1:vobs(C);
     else
-        idB = 1:B.vobs;
-        idC = 1:C.vobs;
+        idB = 1:vobs(B);
+        idC = 1:vobs(C);
     end
 end
 
@@ -77,7 +77,7 @@ if ~isequal(frequency(B),frequency(C))
     error(['dseries::plus: Cannot substract ' inputname(1) ' and ' inputname(2) ' (frequencies are different)!'])
 end
 
-if ~isequal(B.nobs,C.nobs) || ~isequal(firstdate(B),firstdate(C))
+if ~isequal(nobs(B), nobs(C)) || ~isequal(firstdate(B),firstdate(C))
     [B, C] = align(B, C);
 end
 
@@ -94,11 +94,10 @@ end
 A = dseries();
 
 A.dates = B.dates;
-A.nobs = max(B.nobs,C.nobs);
-A.vobs = max(B.vobs,C.vobs);
-A.name = cell(A.vobs,1);
-A.tex = cell(A.vobs,1);
-for i=1:A.vobs
+A_vobs = max(vobs(B), vobs(C));
+A.name = cell(A_vobs,1);
+A.tex = cell(A_vobs,1);
+for i=1:A_vobs
     A.name(i) = {['minus(' B.name{idB(i)} ',' C.name{idC(i)} ')']};
     A.tex(i) = {['(' B.tex{idB(i)} '-' C.tex{idC(i)} ')']};
 end
diff --git a/matlab/@dseries/mpower.m b/matlab/@dseries/mpower.m
index 06cc5af737f357086ba6635e1d80b1fde654bb5b..ef6dc2d9f7f5969fc6aef1a20caac39c5fa8930f 100644
--- a/matlab/@dseries/mpower.m
+++ b/matlab/@dseries/mpower.m
@@ -61,31 +61,27 @@ end
 if isdseries(B) && isnumeric(C) && isreal(C) &&  isscalar(C)
     A = dseries();
     A.dates = B.dates;
-    A.nobs = B.nobs;
-    A.vobs = B.vobs;
-    A.name = cell(A.vobs,1);
-    A.tex = cell(A.vobs,1);
-    for i=1:A.vobs
+    A.data = B.data.^C;
+    A.name = cell(vobs(A),1);
+    A.tex = cell(vobs(A),1);
+    for i=1:vobs(A)
         A.name(i) = {['power(' B.name{i} ',' num2str(C) ')']};
         A.tex(i) = {[B.tex{i} '^' num2str(C) ]};
     end
-    A.data = B.data.^C;
     return
 end
 
 if isdseries(B) && isdseries(C)
-    if isequal(B.nobs,C.nobs) && isequal(B.vobs,C.vobs) && isequal(frequency(B),frequency(C))
+    if isequal(nobs(B),nobs(C)) && isequal(vobs(B), vobs(C)) && isequal(frequency(B),frequency(C))
         A = dseries();
+        A.data = B.data.^C.data;
         A.dates = B.dates;
-        A.nobs = B.nobs;
-        A.vobs = B.vobs;
-        A.name = cell(A.vobs,1);
-        A.tex = cell(A.vobs,1);
-        for i=1:A.vobs
+        A.name = cell(vobs(A),1);
+        A.tex = cell(vobs(A),1);
+        for i=1:vobs(A)
             A.name(i) = {['power(' B.name{i} ',' C.name{i} ')']};
             A.tex(i) = {[B.tex{i} '^{' C.tex{i} '}']};
         end
-        A.data = B.data.^C.data;
     else
         error('dseries::mpower: If both input arguments are dseries objects, they must have the same numbers of variables and observations and common frequency!')
     end
diff --git a/matlab/@dseries/mrdivide.m b/matlab/@dseries/mrdivide.m
index 47d4c2127f2d0d983a1ef7ac858f6646266761df..606cc3b212f30d340b605f9111458b9672c7e514 100644
--- a/matlab/@dseries/mrdivide.m
+++ b/matlab/@dseries/mrdivide.m
@@ -60,33 +60,32 @@ end
 
 if isdseries(B) && isdseries(C)
     % Element by element divisions of two dseries object
-    if ~isequal(B.vobs,C.vobs) && ~(isequal(B.vobs,1) || isequal(C.vobs,1))
+    if ~isequal(vobs(B), vobs(C)) && ~(isequal(vobs(B),1) || isequal(vobs(C),1))
         error(['dseries::times: Cannot divide ' inputname(1) ' and ' inputname(2) ' (wrong number of variables)!'])
     else
-        if B.vobs>C.vobs
-            idB = 1:B.vobs;
-            idC = ones(1:B.vobs);
-        elseif B.vobs<C.vobs
-            idB = ones(1,C.vobs);
-            idC = 1:C.vobs;
+        if vobs(B)>vobs(C)
+            idB = 1:vobs(B);
+            idC = ones(1:vobs(B));
+        elseif vobs(B)<vobs(C)
+            idB = ones(1,vobs(C));
+            idC = 1:vobs(C);
         else
-            idB = 1:B.vobs;
-            idC = 1:C.vobs;
+            idB = 1:vobs(B);
+            idC = 1:vobs(C);
         end
     end
     if ~isequal(frequency(B),frequency(C))
         error(['dseries::times: Cannot divide ' inputname(1) ' and ' inputname(2) ' (frequencies are different)!'])
     end
-    if ~isequal(B.nobs,C.nobs) || ~isequal(firstdate(B),firstdate(C))
+    if ~isequal(nobs(B), nobs(C)) || ~isequal(firstdate(B),firstdate(C))
         [B, C] = align(B, C);
     end
     A = dseries();
     A.dates = B.dates;
-    A.nobs = max(B.nobs,C.nobs);
-    A.vobs = max(B.vobs,C.vobs);
-    A.name = cell(A.vobs,1);
-    A.tex = cell(A.vobs,1);
-    for i=1:A.vobs
+    A_vobs = max(vobs(B),vobs(C));
+    A.name = cell(A_vobs,1);
+    A.tex = cell(A_vobs,1);
+    for i=1:A_vobs
         A.name(i) = {['divide(' B.name{idB(i)} ',' C.name{idC(i)} ')']};
         A.tex(i) = {['(' B.tex{idB(i)} '/' C.tex{idC(i)} ')']};
     end
diff --git a/matlab/@dseries/mtimes.m b/matlab/@dseries/mtimes.m
index 719687efd151b4a0cb8d089bfa9c6fe24ad34e22..d52117dca84fb319c2f668db1535c125c92d28f2 100644
--- a/matlab/@dseries/mtimes.m
+++ b/matlab/@dseries/mtimes.m
@@ -60,33 +60,32 @@ end
 
 if isdseries(B) && isdseries(C)
     % Element by element multiplication of two dseries object
-    if ~isequal(B.vobs,C.vobs) && ~(isequal(B.vobs,1) || isequal(C.vobs,1))
+    if ~isequal(vobs(B), vobs(C)) && ~(isequal(vobs(B),1) || isequal(vobs(C),1))
         error(['dseries::times: Cannot multiply ' inputname(1) ' and ' inputname(2) ' (wrong number of variables)!'])
     else
-        if B.vobs>C.vobs
-            idB = 1:B.vobs;
-            idC = ones(1:B.vobs);
-        elseif B.vobs<C.vobs
-            idB = ones(1,C.vobs);
-            idC = 1:C.vobs;
+        if vobs(B)>vobs(C)
+            idB = 1:vobs(B);
+            idC = ones(1:vobs(B));
+        elseif vobs(B)<vobs(C)
+            idB = ones(1,vobs(C));
+            idC = 1:vobs(C);
         else
-            idB = 1:B.vobs;
-            idC = 1:C.vobs;
+            idB = 1:vobs(B);
+            idC = 1:vobs(C);
         end
     end
     if ~isequal(frequency(B),frequency(C))
         error(['dseries::times: Cannot multiply ' inputname(1) ' and ' inputname(2) ' (frequencies are different)!'])
     end
-    if ~isequal(B.nobs,C.nobs) || ~isequal(firstdate(B),firstdate(C))
+    if ~isequal(nobs(B), nobs(C)) || ~isequal(firstdate(B),firstdate(C))
         [B, C] = align(B, C);
     end
     A = dseries();
     A.dates = B.dates;
-    A.nobs = max(B.nobs,C.nobs);
-    A.vobs = max(B.vobs,C.vobs);
-    A.name = cell(A.vobs,1);
-    A.tex = cell(A.vobs,1);
-    for i=1:A.vobs
+    A_vobs = max(vobs(B),vobs(C));
+    A.name = cell(A_vobs,1);
+    A.tex = cell(A_vobs,1);
+    for i=1:A_vobs
         A.name(i) = {['multiply(' B.name{idB(i)} ',' C.name{idC(i)} ')']};
         A.tex(i) = {['(' B.tex{idB(i)} '*' C.tex{idC(i)} ')']};
     end
diff --git a/matlab/@dseries/ne.m b/matlab/@dseries/ne.m
index b8056d82f07d28ec1480b7f8d47953c9a640f851..ed6e98adce51c669a1637561aa2746caae543c0c 100644
--- a/matlab/@dseries/ne.m
+++ b/matlab/@dseries/ne.m
@@ -37,13 +37,13 @@ if ~(isdseries(A) && isdseries(B))
     error('dseries::ne: Both input arguments must be dseries objects!')
 end
 
-if ~isequal(A.nobs,B.nobs)
+if ~isequal(nobs(A), nobs(B))
     warning('dseries::ne: Both input arguments should have the same number of observations!')
     C = 1;
     return
 end
 
-if ~isequal(A.vobs,B.vobs)
+if ~isequal(vobs(A), vobs(B))
     warning('dseries::ne: Both input arguments should have the same number of observations!')
     C = 1;
     return
diff --git a/matlab/@dseries/nobs.m b/matlab/@dseries/nobs.m
new file mode 100644
index 0000000000000000000000000000000000000000..dc6fc76536d5d8a5d86fc3c731c80a70694fbc28
--- /dev/null
+++ b/matlab/@dseries/nobs.m
@@ -0,0 +1,22 @@
+function s = nobs(ts)
+
+% Returns the number of observations in a @dseries object.
+
+% Copyright (C) 2014 Dynare Team
+%
+% This file is part of Dynare.
+%
+% Dynare is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Dynare is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+
+s = rows(ts.data);
\ No newline at end of file
diff --git a/matlab/@dseries/plot.m b/matlab/@dseries/plot.m
index 26d8e80d057f70da4bfa1f531b218e3de7121dcc..058a44dd0cf1a08af81def389fb0ac868f5dd42b 100644
--- a/matlab/@dseries/plot.m
+++ b/matlab/@dseries/plot.m
@@ -22,26 +22,26 @@ function h = plot(ts, varargin)
 % Get the number of dseries objects
 if isequal(nargin,1)
     ndseries = 1;
-    nvariables = ts.vobs;
-    nobservations = ts.nobs;
+    nvariables = vobs(ts);
+    nobservations = nobs(ts);
 else
     if isdseries(varargin{1})
         ndseries = 2;
-        nvariables = ts.vobs;
-        nobservations = ts.nobs;
+        nvariables = vobs(ts);
+        nobservations = nobs(ts);
         if nargin>2 && any(cellfun(@isdseries,varargin(2:end)))
             error('dseries::plot: You cannot pass more two dseries objects!')
         end
-        if ~isequal(nvariables,varargin{1}.vobs)
+        if ~isequal(nvariables, vobs(varargin{1}))
             error('dseries::plot: The two dseries objects must have the same number of variables!')
         end
-        if ~isequal(nobservations,varargin{1}.nobs)
+        if ~isequal(nobservations, nobs(varargin{1}))
             error('dseries::plot: The two dseries objects must have the same number of observations!')
         end
     else
         ndseries = 1;
-        nvariables = ts.vobs;
-        nobservations = ts.nobs;
+        nvariables = vobs(ts);
+        nobservations = nobs(ts);
     end
 end
 
diff --git a/matlab/@dseries/plus.m b/matlab/@dseries/plus.m
index 9f2ba1eb500614aabd9059ba9a57f0706c5906f3..ee3f0295c0422724ebf99f5a2777cd421b5773be 100644
--- a/matlab/@dseries/plus.m
+++ b/matlab/@dseries/plus.m
@@ -58,18 +58,18 @@ if isnumeric(C) && (isscalar(C) || isvector(C))
     return
 end
 
-if ~isequal(B.vobs,C.vobs) && ~(isequal(B.vobs,1) || isequal(C.vobs,1))
+if ~isequal(vobs(B), vobs(C)) && ~(isequal(vobs(B), 1) || isequal(vobs(C), 1))
     error(['dseries::plus: Cannot add ' inputname(1) ' and ' inputname(2) ' (wrong number of variables)!'])
 else
-    if B.vobs>C.vobs
-        idB = 1:B.vobs;
-        idC = ones(1,B.vobs);
-    elseif B.vobs<C.vobs
-        idB = ones(1,C.vobs);
-        idC = 1:C.vobs;
+    if vobs(B)>vobs(C)
+        idB = 1:vobs(B);
+        idC = ones(1,vobs(B));
+    elseif vobs(B)<vobs(C)
+        idB = ones(1,vobs(C));
+        idC = 1:vobs(C);
     else
-        idB = 1:B.vobs;
-        idC = 1:C.vobs;
+        idB = 1:vobs(B);
+        idC = 1:vobs(C);
     end
 end
 
@@ -77,7 +77,7 @@ if ~isequal(frequency(B),frequency(C))
     error(['dseries::plus: Cannot add ' inputname(1) ' and ' inputname(2) ' (frequencies are different)!'])
 end
 
-if ~isequal(B.nobs,C.nobs) || ~isequal(firstdate(B),firstdate(C))
+if ~isequal(nobs(B), nobs(C)) || ~isequal(firstdate(B),firstdate(C))
     [B, C] = align(B, C);
 end
 
@@ -93,19 +93,16 @@ end
 
 A = dseries();
 
+A.data = bsxfun(@plus,B.data,C.data);
 A.dates = B.dates;
-%A.freq = B.freq;
-%A.init = B.init;
-A.nobs = max(B.nobs,C.nobs);
-A.vobs = max(B.vobs,C.vobs);
-A.name = cell(A.vobs,1);
-A.tex = cell(A.vobs,1);
-for i=1:A.vobs
+
+A_vobs = max(vobs(B), vobs(C));
+A.name = cell(A_vobs,1);
+A.tex = cell(A_vobs,1);
+for i=1:A_vobs
     A.name(i) = {['plus(' B.name{idB(i)} ',' C.name{idC(i)} ')']};
     A.tex(i) = {['(' B.tex{idB(i)} '+' C.tex{idC(i)} ')']};
 end
-A.data = bsxfun(@plus,B.data,C.data);
-%A.dates = A.init:A.init+(A.nobs-1);
 
 %@test:1
 %$ % Define a datasets.
diff --git a/matlab/@dseries/pop.m b/matlab/@dseries/pop.m
index f4f9a5ea19c562d8c2e0468c9c860b970d317ed7..eb398322b3e43b23ed1695353cc5a3eeb8a98780 100644
--- a/matlab/@dseries/pop.m
+++ b/matlab/@dseries/pop.m
@@ -47,7 +47,7 @@ function [ts,id] = pop(ts,a) % --*-- Unitary tests --*--
 
 if nargin<2
     % Removes the last variable
-    id = ts.vobs;
+    id = vobs(ts);
 else
     id = find(strcmp(a,ts.name));
 end
@@ -57,7 +57,6 @@ if isempty(id)
     return
 end
 
-ts.vobs = ts.vobs-1; 
 ts.data(:,id) = [];
 ts.name(id) = [];
 ts.tex(id) = [];
diff --git a/matlab/@dseries/qdiff.m b/matlab/@dseries/qdiff.m
index f57410e31fe389ed3a5d288b962dc7676ed49443..e6ca19ca8d61c2ad4f792b8da5e81cfde5bd3f3d 100644
--- a/matlab/@dseries/qdiff.m
+++ b/matlab/@dseries/qdiff.m
@@ -47,14 +47,14 @@ switch frequency(ts)
   case 4
     us.data(2:end,:) = ts.data(2:end,:)-ts.data(1:end-1,:);
     us.data(1,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['qdiff(' us.name{i} ')']};
         us.tex(i) = {['\Delta ' us.tex{i}]};
     end
   case 12
     us.data(4:end,:) = ts.data(4:end,:)-ts.data(1:end-3,:);
     us.data(1:3,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['qdiff(' us.name{i} ')']};
         us.tex(i) = {['\Delta_3 ' us.tex{i}]};
     end
diff --git a/matlab/@dseries/qgrowth.m b/matlab/@dseries/qgrowth.m
index 796a889bfba2222d494f3abcf0e91c3246d61ad8..30e8d7b69f1954fa0a19ac885dc0f3d0234d0fd5 100644
--- a/matlab/@dseries/qgrowth.m
+++ b/matlab/@dseries/qgrowth.m
@@ -47,14 +47,14 @@ switch frequency(ts)
   case 4
     us.data(2:end,:) = ts.data(2:end,:)./ts.data(1:end-1,:) - 1;
     us.data(1,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['qgrowth(' us.name{i} ')']};
         us.tex(i) = {['\delta ' us.tex{i}]};
     end
   case 12
     us.data(4:end,:) = ts.data(4:end,:)./ts.data(1:end-3,:) - 1;
     us.data(1:3,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['qgrowth(' us.name{i} ')']};
         us.tex(i) = {['\delta_3 ' us.tex{i}]};
     end
diff --git a/matlab/@dseries/save.m b/matlab/@dseries/save.m
index 066d6d8fb404d187233451b9265f6b40fc2823bd..3e8b478fc8ebad46cb55453135ef8a71d8da7385 100644
--- a/matlab/@dseries/save.m
+++ b/matlab/@dseries/save.m
@@ -39,15 +39,15 @@ switch format
     fprintf(fid,'INIT__ = ''%s'';\n',date2string(firstdate(A)));
     fprintf(fid,'\n');
     fprintf(fid,'NAMES__ = {');
-    for i=1:A.vobs
+    for i=1:vobs(A)
         fprintf(fid,[ '''' A.name{i}  '''']);
-        if i<A.vobs
+        if i<vobs(A)
             fprintf(fid,'; ');
         end
     end
     fprintf(fid,'};\n');
     str = 'TEX__ = {';
-    for i=1:A.vobs-1
+    for i=1:vobs(A)-1
         str = [str, '''%s''; '];
     end
     str = [str, '''%s''};'];
@@ -56,7 +56,7 @@ switch format
     str = regexprep(str, pattern, '$1\\\\_');
     fprintf(fid,str);
     fprintf(fid,'\n\n');
-    for v=1:A.vobs
+    for v=1:vobs(A)
         fprintf(fid,'%s = [\n', A.name{v});
         fprintf(fid,'%15.8g\n',A.data(1:end-1,v));
         fprintf(fid,'%15.8g];\n\n',A.data(end,v));
@@ -68,7 +68,7 @@ switch format
     NAMES__ = A.name;
     TEX__ = A.tex;
     str = [];
-    for v=1:A.vobs
+    for v=1:vobs(A)
         str = [str, A.name{v} ' = A.data(:,' num2str(v) ');' ];
     end
     eval(str);
@@ -83,7 +83,7 @@ switch format
     fid = fopen([basename, '.csv'],'w');
     fprintf(fid,',%s', A.name{:});
     fprintf(fid,'\n');
-    for t=1:A.nobs
+    for t=1:nobs(A)
         str = sprintf(', %15.8g',A.data(t,:));
         fprintf(fid, '%s%s\n',date2string(A.dates(t)),str);
     end
diff --git a/matlab/@dseries/set_names.m b/matlab/@dseries/set_names.m
index 68a122db6ec123cd27ba813cf7f6e0361c42d67c..0751872ab43bcf1089100bb54bd9e66ea92b007b 100644
--- a/matlab/@dseries/set_names.m
+++ b/matlab/@dseries/set_names.m
@@ -48,13 +48,13 @@ if ~isdseries(B)
     error(['dseries::rename: ' inputname(1) ' must be a dseries object!'])
 end
 
-if ~isequal(B.vobs,n)
+if ~isequal(vobs(B),n)
     error(['dseries::rename: The number of variables in ' inputname(1) ' does not match the number of declared names!'])
 end
 
 A = B;
 
-for i=1:A.vobs
+for i=1:vobs(A)
     if ~isempty(varargin{i})
         A.name(i) = { varargin{i} };
     end
diff --git a/matlab/@dseries/subsasgn.m b/matlab/@dseries/subsasgn.m
index 3937fd09291a65a5b3f14fd1c4bfc45fc1e292b4..b8abbbbde8869ef5fba4d784d4fe4fb883bc2991 100644
--- a/matlab/@dseries/subsasgn.m
+++ b/matlab/@dseries/subsasgn.m
@@ -83,11 +83,11 @@ switch length(S)
               end
               return
           end
-          if ~isequal(length(S(1).subs),B.vobs)
+          if ~isequal(length(S(1).subs),vobs(B))
               error('dseries::subsasgn: Wrong syntax!')
           end
           if ~isequal(S(1).subs(:),B.name)
-              for i = 1:B.vobs
+              for i = 1:vobs(B)
                   if ~isequal(S(1).subs{i},B.name{i})
                       % Rename a variable.
                       id = find(strcmp(S(1).subs{i},A.name));
@@ -106,13 +106,13 @@ switch length(S)
         case '.'
           if isequal(S(1).subs,'init') && isdates(B) && isequal(length(B),1)
               % Change the initial date (update dates member)
-              A.dates = B:B+(A.nobs-1);
+              A.dates = B:B+(nobs(A)-1);
               return
           elseif isequal(S(1).subs,'dates') && isdates(B)
               % Overwrite the dates member
               A.dates = B;
               return
-          elseif ismember(S(1).subs,{'nobs','vobs','data','name','tex'})
+          elseif ismember(S(1).subs,{'data','name','tex'})
               error(['dseries::subsasgn: You cannot overwrite ' S(1).subs ' member!'])
           elseif ~isequal(S(1).subs,B.name)
               % Single variable selection.
@@ -143,7 +143,7 @@ switch length(S)
                   if isempty(tdy)
                       error('dseries::subsasgn: Periods of the dseries objects on the left and right hand sides must intersect!')
                   end
-                  if ~isequal(A.vobs,B.vobs)
+                  if ~isequal(vobs(A), vobs(B))
                       error('dseries::subsasgn: Dimension error! The number of variables on the left and right hand side must match.')
                   end
                   A.data(tdx,:) = B.data(tdy,:);
@@ -166,28 +166,20 @@ switch length(S)
               if isnumeric(B)
                   if isequal(rows(B),1)
                       A.data = repmat(B,A.dates.ndat,1);
-                      A.nobs = rows(A.data);
-                      A.vobs = columns(A.data);
                   elseif isequal(rows(B),A.dates.ndat)
                       A.data = B;
-                      A.nobs = rows(A.data);
-                      A.vobs = columns(A.data);
                   else
                       error('dseries::subsasgn: Wrong syntax!')
                   end
                   if isempty(A.name)
-                      A.name = default_name(A.vobs);
+                      A.name = default_name(vobs(A));
                       A.tex = name2tex(A.name);
                   end
               elseif isdseries(B)
-                  if isequal(B.nobs,1)
+                  if isequal(nobs(B), 1)
                       A.data = repmat(B.data,A.dates.ndat,1);
-                      A.nobs = rows(A.data);
-                      A.vobs = columns(A.data);
-                  elseif isequal(B.nobs,A.dates.ndat)
+                  elseif isequal(nobs(B), A.dates.ndat)
                       A.data = B;
-                      A.nobs = rows(A.data);
-                      A.vobs = columns(A.data);
                   else
                       error('dseries::subsasgn: Wrong syntax!')
                   end
@@ -211,7 +203,7 @@ switch length(S)
         else
             sA = extract(A,S(1).subs);
         end
-        if (isdseries(B) && isequal(sA.vobs,B.vobs)) || (isnumeric(B) && isequal(sA.vobs,columns(B))) || (isnumeric(B) && isequal(columns(B),1))
+        if (isdseries(B) && isequal(vobs(sA), vobs(B))) || (isnumeric(B) && isequal(vobs(sA),columns(B))) || (isnumeric(B) && isequal(columns(B),1))
             if isdates(S(2).subs{1})
                 [junk, tdx] = intersect(sA.dates.time,S(2).subs{1}.time,'rows');
                 if isdseries(B)
diff --git a/matlab/@dseries/subsref.m b/matlab/@dseries/subsref.m
index 2e74b375f768704c9b58f172016e4db9c547abd0..3f6bf582de566a6ac785e9b41d024835cda98271 100644
--- a/matlab/@dseries/subsref.m
+++ b/matlab/@dseries/subsref.m
@@ -65,7 +65,7 @@ function B = subsref(A, S) % --*-- Unitary tests --*--
 switch S(1).type
   case '.'
     switch S(1).subs
-      case {'data','nobs','vobs','name','tex','dates'}        % Public members.
+      case {'data','name','tex','dates'}        % Public members.
         if length(S)>1 && isequal(S(2).type,'()') && isempty(S(2).subs)
             error(['dseries::subsref: ' S(1).subs ' is not a method but a member!'])
         end
@@ -75,6 +75,12 @@ switch S(1).type
         if length(S)>1 && isequal(S(2).type,'()') && isempty(S(2).subs)
             S = shiftS(S,1);
         end
+      case 'nobs'
+        % Returns the number of observations.
+        B = rows(A.data);
+      case 'vobs'
+        % Returns the number of variables.
+        B = columns(A.data);
       case 'init'
         % Returns a dates object (first date).
         B = A.dates(1);
@@ -177,8 +183,6 @@ switch S(1).type
             B.name = A.name(ndx);
             B.tex = A.tex(ndx);
             B.tex  = deblank(A.tex(ndx,:));
-            B.nobs = A.nobs;
-            B.vobs = 1;
             B.dates = A.dates;
         else
             error('dseries::subsref: Unknown public method, public member or variable!')
@@ -232,8 +236,6 @@ switch S(1).type
         B.data = A.data(tdx,:);
         B.name = A.name;
         B.tex  = A.tex;
-        B.nobs = length(tdx);
-        B.vobs = A.vobs;
         B.dates = A.dates(tdx);
     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!');
@@ -245,15 +247,13 @@ switch S(1).type
         B = extract(A,S(1).subs{:});
     elseif isequal(length(S(1).subs),1) && all(isint(S(1).subs{1}))
         idx = S(1).subs{1};
-        if max(idx)>A.vobs || min(idx)<1
+        if max(idx)>size(A.data,2) || min(idx)<1
             error('dseries::subsref: Indices are out of bounds!')
         end
         B = dseries();
         B.data = A.data(:,idx);
         B.name = A.name(idx);
         B.tex  = A.tex(idx);
-        B.nobs = A.nobs;
-        B.vobs = length(idx);
         B.dates = A.dates;
     else
         error('dseries::subsref: What the Hell are you tryin'' to do?!')
diff --git a/matlab/@dseries/tex_rename.m b/matlab/@dseries/tex_rename.m
index ae9975507ace347037368f3a8a5eea8b882954ae..86e3bf974fd852f607b878e361229bc1ff759477 100644
--- a/matlab/@dseries/tex_rename.m
+++ b/matlab/@dseries/tex_rename.m
@@ -21,7 +21,7 @@ assert(nargin <= 3, 'dseries::tex_rename: accepts at most three args');
 
 if nargin == 2
     newtexname = varargin{1};
-    assert(ts.vobs == 1, ['dseries::tex_rename: with one argument, the dseries contain only one variable.']);
+    assert(vobs(ts) == 1, ['dseries::tex_rename: with one argument, the dseries contain only one variable.']);
 else
     newtexname = varargin{2};
     name = varargin{1};
diff --git a/matlab/@dseries/uminus.m b/matlab/@dseries/uminus.m
index e8214cd59449d1a38091971a7bd827def4f34a4c..000fbda74873b75eacecf9bfc569b2a76665144e 100644
--- a/matlab/@dseries/uminus.m
+++ b/matlab/@dseries/uminus.m
@@ -42,16 +42,15 @@ function A = uminus(B) % --*-- Unitary tests --*--
 
 A = dseries();
 
-A.nobs = B.nobs;
-A.vobs = B.vobs;
+A.data = -(B.data);
 A.dates = B.dates;
-A.name = cell(A.vobs,1);
-A.tex = cell(A.vobs,1);
-for i = 1:A.vobs
+
+A.name = cell(vobs(A),1);
+A.tex = cell(vobs(A),1);
+for i = 1:vobs(A)
     A.name(i) = {[ '-' B.name{i}]};
     A.tex(i) = {[ '-' B.tex{i}]};
 end
-A.data = -(B.data);
 
 %@test:1
 %$ % Define a datasets.
diff --git a/matlab/@dseries/vertcat.m b/matlab/@dseries/vertcat.m
index 4b4a680fe6005578a7d67adaff7b073846078d8f..ad2af8b073611d2705937980553815a422ea6027 100644
--- a/matlab/@dseries/vertcat.m
+++ b/matlab/@dseries/vertcat.m
@@ -63,7 +63,7 @@ function d = vertcat_(b, c)
     if ~isequal(frequency(b), frequency(c))
         error('dseries::vertcat: Frequencies must be common!')
     end
-    if ~isequal(b.vobs, c.vobs)
+    if ~isequal(vobs(b), vobs(c))
         error('dseries::vertcat: Number of variables must be common!')
     end
     if ~isequal(b.name, c.name)
@@ -72,7 +72,6 @@ function d = vertcat_(b, c)
     d = b;
     d.data = [b.data; c.data];
     d.dates = [b.dates; c.dates];
-    d.nobs = b.nobs+c.nobs;
 
 %@test:1
 %$ % Define a data set.
diff --git a/matlab/@dseries/vobs.m b/matlab/@dseries/vobs.m
new file mode 100644
index 0000000000000000000000000000000000000000..37c1c80dd31eb48cfdbeda31a70e8ef5988fc33e
--- /dev/null
+++ b/matlab/@dseries/vobs.m
@@ -0,0 +1,22 @@
+function s = vobs(ts)
+
+% Returns the number of variables in a @dseries object.
+
+% Copyright (C) 2014 Dynare Team
+%
+% This file is part of Dynare.
+%
+% Dynare is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Dynare is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+
+s = columns(ts.data);
\ No newline at end of file
diff --git a/matlab/@dseries/ydiff.m b/matlab/@dseries/ydiff.m
index beee58c8ac649511949712b59b357e1d7388b184..d50200b57f5841940c859a5f5822da32cde21f5b 100644
--- a/matlab/@dseries/ydiff.m
+++ b/matlab/@dseries/ydiff.m
@@ -45,28 +45,28 @@ switch frequency(ts)
   case 1
     us.data(2:end,:) = ts.data(2:end,:)-ts.data(1:end-1,:);
     us.data(1,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ydiff(' us.name{i} ')']};
         us.tex(i) = {['\Delta ' us.tex{i}]};
     end
   case 4
     us.data(5:end,:) = ts.data(5:end,:)-ts.data(1:end-4,:);
     us.data(1:4,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ydiff(' us.name{i} ')']};
         us.tex(i) = {['\Delta_4 ' us.tex{i}]};
     end
   case 12
     us.data(13:end,:) = ts.data(13:end,:)-ts.data(1:end-12,:);
     us.data(1:12,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ydiff(' us.name{i} ')']};
         us.tex(i) = {['\Delta_{12} ' us.tex{i}]};
     end
   case 52
     us.data(53:end,:) = ts.data(53:end,:)-ts.data(1:end-52,:);
     us.data(1:52,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ydiff(' us.name{i} ')']};
         us.tex(i) = {['\Delta_{52} ' us.tex{i}]};
     end
diff --git a/matlab/@dseries/ygrowth.m b/matlab/@dseries/ygrowth.m
index ba988ec2e13b5f0ac47b6a9840804de18795c816..9b50c38c93b97d4bc73fc1c31d05a6e9030036ad 100644
--- a/matlab/@dseries/ygrowth.m
+++ b/matlab/@dseries/ygrowth.m
@@ -45,28 +45,28 @@ switch frequency(ts)
   case 1
     us.data(2:end,:) = ts.data(2:end,:)./ts.data(1:end-1,:) - 1;
     us.data(1,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ygrowth(' us.name{i} ')']};
         us.tex(i) = {['\delta ' us.tex{i}]};
     end
   case 4
     us.data(5:end,:) = ts.data(5:end,:)./ts.data(1:end-4,:) - 1;
     us.data(1:4,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ygrowth(' us.name{i} ')']};
         us.tex(i) = {['\delta_4 ' us.tex{i}]};
     end
   case 12
     us.data(13:end,:) = ts.data(13:end,:)./ts.data(1:end-12,:) - 1;
     us.data(1:12,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ygrowth(' us.name{i} ')']};
         us.tex(i) = {['\delta_{12} ' us.tex{i}]};
     end
   case 52
     us.data(53:end,:) = ts.data(53:end,:)./ts.data(1:end-52,:) - 1;
     us.data(1:52,:) = NaN;
-    for i = 1:ts.vobs
+    for i = 1:vobs(ts)
         us.name(i) = {['ygrowth(' us.name{i} ')']};
         us.tex(i) = {['\delta_{52} ' us.tex{i}]};
     end