You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: normrow.m
    path of file: ./repos/gptoolbox/matrix
    
    the code of the file until where you have to start completion: function [ B ] = normrow( A )
  % NORMROW  Compute l2 row vector norms
  %
  % B = normrow( A )
  %
  % Input:
  %  A  #A by D list of row vectors of dimension D
  % Output:
  %  B  #A list of norms of row vectors in A
  %
  % Copyright 2011, Alec Jacobson (jacobson@inf.ethz.ch), Daniele Panozzo

    
function [ B ] = normrow( A )
  % NORMROW  Compute l2 row vector norms
  %
  % B = normrow( A )
  %
  % Input:
  %  A  #A by D list of row vectors of dimension D
  % Output:
  %  B  #A list of norms of row vectors in A
  %
  % Copyright 2011, Alec Jacobson (jacobson@inf.ethz.ch), Daniele Panozzo
  %

  switch size(A,2)
  case 2
    B = hypot(A(:,1),A(:,2));
  otherwise
    %B = sqrt(sum(A.^2,2));
    M = max(abs(A),[],2);
    B = M.*sqrt(sum((A./M).^2,2));
    B(M==0) = 0;
  end