[心得] 利用matlab轉圖檔至eps的方法
相信這個版很多人會因為要寫論文
因此需要將圖檔轉成eps檔案編譯
之前爬文找方法 有人說可以利用matlab寫幾行code即可
但是我想很多人其實不知道如何寫code (我就是其中之一)
這邊提供程式碼會與用matlab但不會轉檔的人 m 函式
函式引用於以下網站
http://www.cs.cmu.edu/~jkubica/code/matlabToEPS.html
===============分隔線======================================
將以下檔案存成 convertToEPS.m 檔
% convertToEPS(imgName,type)
% By Jeremy Kubica, 2001
%
% Uses Matlab to convert a image file into a EPS file.
% imgName - the name of the image file
% type - the file type
%
% Example: to convert file "sample.jpg" to "sample.esp"
% convertToEPS('sample','jpg');
% New file is saved as imgName.esp
function convertToEPS(imgName,type)
pic = imread(imgName,type);
[y x c] = size(pic)
figure('Units','Pixels','Resize','off',...
'Position',[100 100 x y],'PaperUnit','points',...
'PaperPosition',[0 0 x y]);
axes('position',[0 0 1 1]);
image(pic);
axis off
saveas(gcf,imgName,'epsc');
=============分隔線==============================
將此函式存檔後 只需要將圖檔跟此m檔案放在一起
輸入
convertToEPS('圖檔檔名','圖檔副檔名');
即可
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.210.140.72
推
04/24 16:40, , 1F
04/24 16:40, 1F
LaTeX 近期熱門文章
PTT數位生活區 即時熱門文章