Matlab publish not showing all output.
조회 수: 52 (최근 30일)
이전 댓글 표시
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.
Here is a potentially relevant issue someone else had: https://www.mathworks.com/matlabcentral/answers/367530-problem-with-publish-and-fprintf?s_tid=mwa_osa_a
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!
댓글 수: 0
답변 (1개)
Pratik
2023년 10월 11일
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!