How can I set the of margins of the page configuration in Matlab R2016a?
32 次查看(过去 30 天)
显示 更早的评论
I can't modify the page margins in this version of Matlab, while I could in Matlab R2010a.
What can I do?
0 个评论
回答(1 个)
Sharmila Raghu
2016-6-1
Hi Oscar,
I believe that you want to change the margins of the page configuration when you want to take a printout of your code from the Editor. The releases prior to MATLAB R2012a allows user to change the print margin via "File > Print > Page Setup". However, starting from MATLAB R2012a, this feature is no longer available.
There are two workarounds for this issue:
1. Physically tab all the code to create the indentation. This can be achieved quickly by pressing Ctrl+A in the Editor to select all the code and pressing TAB on the keyboard to indent the code.
2. Open and print the M-file in Wordpad. Wordpad has the functionality to adjust the margins of the code printout.
A simple self written MATLAB function is attached to ease the process of opening M-files using Wordpad. This function is called "openUsingWordpad.m".
function openUsingWordpad(filename)
%openUsingWordpad(FILENAME): This is a simple function to open M-files or textfiles
%using Wordpad for more printing options. FILENAME is a string representing
%the filename plus the extension of the file to be opened.
system(['start wordpad ' filename]);
end
For example, if you want to open a file "foo.m" in your working directory, simply include the above function "openUsingWordpad" in your working directory and execute the following command in the MATLAB Command Window:
>> openUsingWordpad('foo.m');
I work for MathWorks and I have forwarded this feedback to the appropriate product team.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!