我是靠谱客的博主 喜悦小虾米,这篇文章主要介绍matlab mdl 保存图片,simulink 仿真图如何转化成图片格式,现在分享给大家,希望可以做个参考。

擅长: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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(59)

评论列表共有 0 条评论

立即
投稿
返回
顶部