Let's first reformat the code to be more legible...
function [Tx,freq,analysisParam,params] = wsstImpl(x,fsOrTs,namedargs)
x {mustBeVector,mustBeFloat,mustBeReal,mustBeFinite}
fsOrTs {mustBeScalarOrEmpty} = []
namedargs.Name {mustBeTextScalar} = 'amor'
namedargs.VoicesPerOctave (1,1) {mustBeNumeric, ...
vcoMustBeEven(namedargs.VoicesPerOctave), ...
mustBeInRange(namedargs.VoicesPerOctave,10,48,"inclusive"), ...
vcoMustBeEven(namedargs.VoicesPerOctave)} = 32
namedargs.ExtendSignal (1,1) logical = false
namedargs.WaveletParameters {mustBeNumeric,mustBePositive}
Now looking at the validation, it is saying that first VoicesPerOctave --
If passed, must be
- a single element of a numeric class, then
- integer-valued, then
- even-valued, and
- within the range of 10 to 48, inclusive.
Finally, if not passed, the default value of 32 is set.
These are relatively easy to figure out what are doing, but the only way to really understand in depth is to learn the syntax and behavior of the MATLAB validation functions. Start with the <Function Argument Validation> page to get an overview of the forest instead of trying at the tip of the smallest branch of a single tree. As outlined in the details of argument validation you'll get to if you read the above reference, validation is a sequential process; the most generic must be verified first such that later checking can assume certain things are true. For example, the very first steps above wouldn't work if were reversed; "even" isn't defined unless the argument is numeric.
As far as the original question regarding how to understand the implementation of a computational algorithm, you can almost completely ignore the argument validation code; it has no direct bearing on the actual calculation; it just ensures that the code will have the types and ranges of values expected up front so the actual working code sections don't have to worry about whether an assumption has been violated.
The thing to do is to start with the "Algorithms" and "Reference" sections to see what bread crumbs Mathworks has left for you in the documentation and then obtain and read the references to understand the general concepts being applied. Once you understand that theory, then walking through the code will be at least somewhat simpler; just how difficult to follow will depend a lot upon just how clever the person who implemented it was in utilizing internals or specific features of MATLAB syntax for performance reasons.