In the MATLAb Function block, %#codegen is what we call a Compilation Directive. It is added to indicate that this MATLAB function is going to go through C-code generation when you hit the 'Deploy to Hardware' button.
For more info on this, see here:
Typically, every MATLAb Function blocks added to a Simulink has this by default. When working with the VEX hardware, make sure to leave this directive as such so that it doesn't affect to 'Deploy to Hardware' behavior later. Do not modify this line!
As for the "%" symbol in MATLAB, this is used to add 'comments' to your code. So yes, in the ladder example, "%i.e. u =4" was a comment that I had added to clarify what that line of code does. Comments have no affect on the function/execution of the code itself. They are merely added for documentation/notation purposes. (In C, you would use // for adding comments)
a = 10; %Adding comment that a is a variable that is assigned a value of 10
b =a +1; %Increment a by 1 and assign it to b