在matlab中的图像上的文本

时间:2015-02-25 15:18:06

标签: matlab

我需要写入count的值而不是字符串" count"在图像上 我该怎么办?

htxtins = vision.TextInserter('count');

htxtins.Color = [255, 255, 255]; 
htxtins.FontSize = 24;
htxtins.Location = [5 50]; 
J = step(htxtins,frame);

1 个答案:

答案 0 :(得分:1)

假设count的值存储在名为count的变量中,那么

vision.TextInserter(num2str(count));

会做的。

如果您想创建更复杂的字符串,可以使用strcat,例如

strcat('Count =',num2str(count))