To find the magnitude (also called the length or norm) of a vector in MATLAB, you can use the norm() function. The syntax is as follows:
main.m25 chars2 lines
For example, if you have a vector v = [3 4], you can find its magnitude as follows:
main.m20 chars2 lines
This will return the value 5, which is the length of the vector v.
gistlibby LogSnag