function x = vecNorm(a) % vecNorm - compute the Euclidian norm of a vector in R2 % % % Syntax: % x = vecNorm(a) % Arguments: % a - the vector % Returns: % x - the norm of the vector % % Description: % % Compute the norm of the vector a % |a| = (a.a)^(1/2) % % See also: % %---------------------------------------------------------------------- % Bugs: % % Date created: % 990910 % Author: % Marten Levenstam % % Change history: % % +---------------------------------------+ % | Matematik Kf/Kb 1999-2000 | % | Copyright (c) 1999 | % | | % | Marten Levenstam | % | Klas Samuelsson | % | Dep. of Mathematics | % | Chalmers University of Technology | % | S-412 96 Gothenburg | % | SWEDEN | % | martenl@math.chalmers.se | % | | %------------------------------+---------------------------------------+ if vecIsInR2(a) x = sqrt(vecDot(a, a)); else error('vecPlot: a is not in R2'); end