【发布时间】:2011-04-12 11:23:44
【问题描述】:
我想做
for i = 1 : size(N, 2)
figure(i);
title('N = %d', i);
%other stuff
但设置标题不起作用。为什么?
【问题讨论】:
我想做
for i = 1 : size(N, 2)
figure(i);
title('N = %d', i);
%other stuff
但设置标题不起作用。为什么?
【问题讨论】:
因为你忘了加sprintf
for i = 1 : size(N, 2)
figure(i);
title(sprintf('N = %i', i)); %# %i for integer
%other stuff
end
【讨论】:
num2str 应该也可以。
title(['N = ',num2str(i)]);
【讨论】: