function [c]=mult_mat_vec_ele(A,b);
%% comput c=Ab element by element

%% dimension
[nrA,ncA]=size(A);
[nrb,ncb]=size(b);

%% check
if(ncA-nrb~=0);
    fprintf('\n  in [c]=mult_mat_vec_col(A,b)')
    fprintf('\n      dim (A): [nrA,ncA]=[%d,%d]',size(A))
    fprintf('\n      dim (b): [nrb,ncb]=[%d,%d]',size(b))
    input('\n         ... inconsistency on ncA=nrb.   ^c to stop  ')
end
if(ncb~=1);
    fprintf('\n  in [c]=mult_mat_vec_col(A,b)')
    fprintf('\n      dim (b): [nrb,ncb]=[%d,%d]',size(b))
     input('\n         ... inconsistency on ncb=1.   ^c to stop  ')   
end
%% c=Ab: brute force
c=zeros(nrA,1);
for nr=1:nrA;
    for nc=1:ncA;
        c(nr)=c(nr)+A(nr,nc)*b(nc);
    end
end

return
