1 2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3// Copyright (C) ????-2008 - INRIA 4// 5// Copyright (C) 2012 - 2016 - Scilab Enterprises 6// 7// This file is hereby licensed under the terms of the GNU GPL v2.0, 8// pursuant to article 5.3.4 of the CeCILL v.2.1. 9// This file was originally licensed under the terms of the CeCILL v2.1, 10// and continues to be available under such terms. 11// For more information, see the COPYING file which you should have received 12// along with this program. 13 14function [y]=proj(x1,x2) 15 //[y]=proj(x1,x2) projection on x2 parallel to x1 16 //F.D. 17 //! 18 [l,k]=size(x1); 19 [w,n]=rowcomp(x1);w1=w(:,1:n); 20 x1t=w(n+1:l,:); 21 y=x2/(x1t*x2)*x1t 22endfunction 23