function [ c ] = myconv1(a, b)
%MYCONV1 returns the convolution of vectors a and b
%   It is a simple replication of built-in conv
%   We use different indexing than myconv
%   Minas Spetsakis (March 24 2019)

N = length(a);
M = length(b);

c = zeros(1,N+M-1);

for k=1:N+M-1
    imin = max(1,k-M+1);
    imax = min(k,N);
    for i=imin:imax
        c(k) = c(k)+a(i)*b(k-i+1);
    end
end

end

