clear format compact %% % Define the vectors m = 4; z = ones(m, 1); % ||z|| = 2 e1 = eye(m, 1); %% % Applying the Householder definitions gives us v = norm(z)*e1 - z; P = eye(m) - 2/(v'*v)*(v*v'); % reflector %% % By design we can use the reflector to get the structure we seek: P*z %% % Verify norm(P*z - e1*norm(z))