When you print MATLAB code or the published form of the code, you may find the code or the comments getting cut off. The solution to these problems is given at several places in MATLAB blogs and documentation. In this blog, I have summarized what to do as the issues of code getting cut off falls into three categories
- Break long lines by using the … command. See this link for examples and the nature of the command
http://www.mathworks.com/help/techdoc/matlab_prog/bsw6ppl-1.html - Break long comments simply by putting them on separate lines
For example
% My name is Autar, my age is 20, my major is Mechanical Engg
can be written as
% My name is Autar
% my age is 20
% my major is Mechanical Engg - Break long strings such as in fprint statements by concatenating strings.
http://www.mathworks.com/help/techdoc/ref/strcat.html
____________________________________________
This post is brought to you by Holistic Numerical Methods: Numerical Methods for the STEM undergraduate at http://numericalmethods.eng.usf.edu, the textbook on Numerical Methods with Applications available from the lulu storefront, the textbook on Introduction to Programming Concepts Using MATLAB, and the YouTube video lectures available at http://numericalmethods.eng.usf.edu/videos. Subscribe to the blog via a reader or email to stay updated with this blog. Let the information follow you.