function [ amplitude ] = vecLen( inputVector )
%This function determines the vector length of a 2D vector
%Who wrote this?
%When? 

%All the functionality of this function could be done in one line.
%For didactic reasons, we use multiple lines.
%Because of scope.
%Anything that happens in a function stays in the function unless you
%output it.
%Scripts access the general workspace. Functions do not. They only see what
%you give them as inputs and only put into the workspace what you
%explicitly declare. 

magnitude = sqrt(inputVector(1).^2+inputVector(2).^2);
amplitude = magnitude; %Sounds tautological. But this is not a test of equality, it is an assignment. 
maham = 5; %Unless output, this stays in the workspace of the function

%ALWAYS test functions with use cases where you know what the output should
%be, where you know "ground truth". Try multiple cases!

%THIS function expects a 2D vector. We specified this right on top. 
%But if you give it a longer vector, it doesn't throw an error, it makes a
%logical mistake, by simply taking the first 2 elements.
%So functions checking the dimensionality of the input they expect
%is *critical*. However, for didactic reasons, we will do that next time. 


end

