如何在绘图中的matlab中打印一些文本?

时间:2015-03-29 14:07:20

标签: matlab

在Matlab中,我想在Matlab中的绘图中打印如下代码。 代码lise this,

for i=1:100
print("%d",i);
end

如何在剧情中用Matlab打印一些文字?

2 个答案:

答案 0 :(得分:1)

使用matlab text命令。 link

答案 1 :(得分:1)

扩展Tal Darom's回答

<强>垂直

figure; axis([0,20,0,60], 'image'); %image -> for 1:1 scale
for i=1:10
text(10, i*5, num2str(i)); %text can only print strings. so converting number to string
end

<强>结果:

enter image description here

<强>水平

figure; axis([0,60,0,20], 'image'); %image -> for 1:1 scale
for i=1:10
text(i*5, 10, num2str(i)); %text can only print strings. so converting number to string
end

<强>结果:

enter image description here

我认为你可以通过调整代码来改变它们的打印价值和位置