Matlab自动重命名情节标题与循环 [英] matlab rename plot title automatically with loop

查看:690
本文介绍了Matlab自动重命名情节标题与循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在循环中重命名地块.我尝试过

I have trouble renaming my plots in a loop. I tried

for Yearnumber 2000:2018
 etc etc
title('Plot for year %g',Yearnumber,'FontSize',20);

end

类似于我在sprintf中键入的内容,但是它不起作用.有什么办法可以使它循环不断吗?

similar to what I type into sprintf but it doesnt work. Is there any way to make it loop through the years?

推荐答案

您可以在title()

for Yearnumber = 2000:2018
    title( sprintf( 'Plot for year %g', Yearnumber ), 'FontSize', 20);
end

这篇关于Matlab自动重命名情节标题与循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆