擅长:LS-DYNA
首先编写截图子函数并命名为 jietu_mdl。
function jietu_mdl(bpath)
if nargin < 1
files=dir('*.mdl');
else
[pathstr,name] = fileparts(bpath);
if exist(bpath,'dir')
name = [name '*'];
end
ext = '.mdl';
files=dir(fullfile(pathstr,[name ext]));
end
if ~isempty(files)
whandle = actxserver('word.application');
whandle.Visible = 1;
Add(whandle.Documents);
sel=whandle.Selection;
set(sel.ParagraphFormat,'Alignment','wdAlignParagraphLeft');
set(sel.PageSetup,'LeftMargin',28.35,'RightMargin',28.35,'BottomMargin',28.35*1.43);
for index=1:size(files,1)
title=files(index).name;
eval(title(1:end-4));
print('-dmeta',['-s', title(1:end-4)]);
bdclose;
close('all');
TypeText(sel,title);
set(sel.ParagraphFormat,'KeepWithNext',-1)
TypeParagraph(sel);
Paste(sel);
set(sel.ParagraphFormat,'KeepWithNext',0)
TypeParagraph(sel);
end
release(whandle);
end
return
然后在 MATLAB 主界面运行调用截图函数 jietu_mdl('shiyan') 可得图。
最后
以上就是喜悦小虾米最近收集整理的关于matlab mdl 保存图片,simulink 仿真图如何转化成图片格式的全部内容,更多相关matlab内容请搜索靠谱客的其他文章。
发表评论 取消回复