废话不多说。
str='E';
scale=10;
% 绘制 3D 文字
new_fig = figure('visible','on');
word_handle = text(0.01,0.5,str,...
'fontsize',200,...
'fontweight','bold',...
'fontunits','normalized');
axis off
set(gcf,'PaperPosition',[0 0 8 8],'PaperUnits','normalized')
% saveas(gca,[pwd '1.png']);
export_fig ecnu.png
delete(new_fig);
I = imread([pwd '1.png']);
BW = ~im2bw(I,0.6);
[x,y] = find(BW);
BW = BW(min(x):max(x),min(y):max(y));
BW = flipud(BW);
[m,n] = size(BW);
BW0 = zeros(m+2,n+2);
BW0(2:m+1,2:n+1) = BW;
[m,n] = size(BW0);
[X,Y] = meshgrid(1:n,1:m);
Z = scale*BW0;
figure
surf(X,Y,Z);
colormap(jet);
shading interp;
axis equal;
axis off;