You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ttv.m
    path of file: ./repos/imtsl/libs/tensor_toolbox_2.5/@tensor
    
    the code of the file until where you have to start completion: function c = ttv(a,v,dims)
%TTV Tensor times vector.
%
%   Y = TTV(X,A,N) computes the product of tensor X with a (column)
%   vector A.  The integer N specifies the dimension in X along which
%   A is multiplied.  If size(A) = [I,1], then X must have size(X,N) =
%   I.  Note that ndims(Y) = ndims(X) - 1 because the N-th dimension
%   is removed.
%
%   Y = TTV(X,{A,B,C,...}) computes the product of tensor X with a
%   sequence of vectors in the cell array.  The products are computed
%   sequentially along all dimensions (or modes) of X. The cell array
%   contains ndims(X) vectors.
%
%   Y = TTV(X,{A,B,C,...},DIMS) computes the sequence of tensor-vector
%   products along the dimensions specified by DIMS.
%
%   Examples
%   X = tensor(rand(5,3,4,2));
%   A = rand(5,1); B = rand(3,1); C = rand(4,1); D = rand(2,1);
%   Y = ttv(X, A, 1) %<-- X times A in mode 1
%   Y = ttv(X, {A,B,C,D}, 1) %<-- same as above
%   Y = ttv(X, {A,B,C,D}, [1 2 3 4]) %<-- All-mode multiply
%   Y = ttv(X, {D,C,B,A}, [4 3 2 1]) %<-- same as above
%   Y = ttv(X, {A,B,C,D}) %<-- same as above

    
function c = ttv(a,v,dims)
%TTV Tensor times vector.
%
%   Y = TTV(X,A,N) computes the product of tensor X with a (column)
%   vector A.  The integer N specifies the dimension in X along which
%   A is multiplied.  If size(A) = [I,1], then X must have size(X,N) =
%   I.  Note that ndims(Y) = ndims(X) - 1 because the N-th dimension
%   is removed.
%
%   Y = TTV(X,{A,B,C,...}) computes the product of tensor X with a
%   sequence of vectors in the cell array.  The products are computed
%   sequentially along all dimensions (or modes) of X. The cell array
%   contains ndims(X) vectors.
%
%   Y = TTV(X,{A,B,C,...},DIMS) computes the sequence of tensor-vector
%   products along the dimensions specified by DIMS.
%
%   Examples
%   X = tensor(rand(5,3,4,2));
%   A = rand(5,1); B = rand(3,1); C = rand(4,1); D = rand(2,1);
%   Y = ttv(X, A, 1) %<-- X times A in mode 1
%   Y = ttv(X, {A,B,C,D}, 1) %<-- same as above
%   Y = ttv(X, {A,B,C,D}, [1 2 3 4]) %<-- All-mode multiply
%   Y = ttv(X, {D,C,B,A}, [4 3 2 1]) %<-- same as above
%   Y = ttv(X, {A,B,C,D}) %<-- same as above
%   Y = ttv(X, {C,D}, [3 4]) %<-- X times C in mode-3 & D in mode-4
%   Y = ttv(X, {A,B,C,D}, [3 4]) %<-- same as above
%   Y = ttv(X, {A,B,D}, [1 2 4]) %<-- 3-way mutplication
%   Y = ttv(X, {A,B,C,D}, [1 2 4]) %<-- same as above
%   Y = ttv(X, {A,B,D}, -3) %<-- same as above
%   Y = ttv(X, {A,B,C,D}, -3) %<-- same as above
%
%   See also TENSOR, TENSOR/TTT, TENSOR/TTM.
%
%MATLAB Tensor Toolbox.
%Copyright 2012, Sandia Corporation.

% This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others.
% http://www.sandia.gov/~tgkolda/TensorToolbox.
% Copyright (2012) Sandia Corporation. Under the terms of Contract
% DE-AC04-94AL85000, there is a non-exclusive license for use of this
% work by or on behalf of the U.S. Government. Export of this data may
% require a license from the United States Government.
% The full license terms can be found in the file LICENSE.txt


% Check the number of arguments
if (nargin < 2)
    error('TTV requires at least two arguments.');
end