Clear Filters
Clear Filters

Matlab publish not showing all output.

13 views (last 30 days)
Ryley Hindman
Ryley Hindman on 12 Apr 2022
Answered: Pratik on 11 Oct 2023
I have a MATLAB script that solves inverse kinematics for a particular robotic manipulator. I am trying to publish the code, as well as the output. When I run the script normally, I get the correct output in the command window. When I use the 'publish' feature, not all of the output is included in the published document, and the output that is included is seemingly randomly distributed. I think it might have something to do with the functions I have in my software.
However, I don't have functions calling other functions within them like the issue linked above does, so I'm still confused about what my issue might be.
I have a workaround for now, where I can save the output from the command window seperately and then combine it with the published code-only later, but I would like to get this working properly.
My code is attached. Thanks in advance!

Answers (1)

Pratik
Pratik on 11 Oct 2023
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!

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!