1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 2// Copyright (C) INRIA 3// 4// Copyright (C) 2012 - 2016 - Scilab Enterprises 5// 6// This file is hereby licensed under the terms of the GNU GPL v2.0, 7// pursuant to article 5.3.4 of the CeCILL v.2.1. 8// This file was originally licensed under the terms of the CeCILL v2.1, 9// and continues to be available under such terms. 10// For more information, see the COPYING file which you should have received 11// along with this program. 12 13function M1=%hm_f_hm(M1,M2) 14 15 d1=size(M1); 16 d2=size(M2); 17 if size(d1,"*")<>size(d2,"*") then 18 error(msprintf(_("%s: In concatenation the number of dimensions for each component must match.\n"),"%hm_f_hm")); 19 end 20 21 kd=find(d1(2:$)<>d2(2:$)) 22 if kd<>[] then 23 error(msprintf(_("%s: Inconsistent dimensions.\n"),"%hm_f_hm")); 24 end 25 26 d3 = d1; 27 d3(1) = d1(1) + d2(1); 28 M1=matrix([matrix(M1,double(d1(1)),-1) ; matrix(M2,double(d2(1)),-1)], d3) 29endfunction 30