Hi Rylel,
In my understanding you are attempting to publish the code along with all its output, but not all the output is getting published. Also, some outputs are getting published randomly.
Publish has a limitation while using subfunctions defined in the same file as the publish script. Thus, there is issue while including output with the code at the time of publish. After moving the function “forwardKine” and “inverseKine” to a different file all the output was getting published. All output gets published as it was getting printed in output.
Alternatively, you may try the live editor which has better support for subfunctions.
Please refer to the following MathWorks documentation link for more information on MATLAB Live Editor:
Hope this helps!