Commit 15df9972 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added argument to shiftS routine so that it can be called recursively to...

Added argument to shiftS routine so that it can be called recursively to remove more than one element in a one dimensional cell array.
parent a15cf73a
function S = shiftS(S)
function S = shiftS(S,n)
%function S = shiftS(S)
%
% Removes the first element of a one dimensional cell array.
......@@ -20,9 +20,18 @@ function S = shiftS(S)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if nargin<2
n = 1;
end
if length(S) > 1
S = S(2:end);
n = n-1;
else
S = {};
n = 0;
end
end
if n
S = shiftS(S,n);
end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment