昨天在寫通訊原理大作業時,想給
查閱了官方的文件,有幾行程式碼可以起作用。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Exporting a figure in Matlab to PDF often outputs an A4-sized pdf file. This snippet can export a minimal size pdf which can be used in TeX files directly. | |
% some figures here | |
figure; | |
plot(zeros([1, 5])); | |
% codes that works | |
fig = gcf; | |
fig.PaperPositionMode = 'auto'; | |
fig_pos = fig.PaperPosition; | |
fig.PaperSize = [fig_pos(3) fig_pos(4)]; |
實際使用時,如果使用的是