% replace maple hessian for matlab student versions

function [hess]=hessian_s(model,variables);

if ~issym(model)
modsym=cell2sym(model);
else
    modsym=model;
end
if ~issym(variables)
varsym=cell2sym(variables);
else
    varsym=variables;
end
szmod=size(modsym,1);
if szmod>1
    error('hessian_s computes the hessian for one equation at a time');
end
% keyboard
hess=double(jacobian(jacobian(modsym,varsym),varsym));

return
% tic
% szvar=size(varsym,1);
% hess=sym([]);
% for jj=1:szvar;
%     for kk=1:szvar;
%       hess(jj,kk)=diff(diff(modsym,varsym(jj)),varsym(kk));
%     end
% end
% hess=char(hess);
% toc
% return