8
可变我想做MATLAB - 在情节标题
for i = 1 : size(N, 2)
figure(i);
title('N = %d', i);
%other stuff
但设置标题不起作用。为什么?
可变我想做MATLAB - 在情节标题
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)]);