0
我正在寻找一种方法将变量的值打印到Psychtoolbox(Matlab)中的屏幕上。我正在寻找像fprintf
:例如。 fprintf('%s%d\n','Your score: ', score);
在Psychtoolbox中打印变量值
我猜DrawFormattedText()
是我在找的函数,但有人建议如何添加一个不是字符串的一部分的变量?
谢谢。
我正在寻找一种方法将变量的值打印到Psychtoolbox(Matlab)中的屏幕上。我正在寻找像fprintf
:例如。 fprintf('%s%d\n','Your score: ', score);
在Psychtoolbox中打印变量值
我猜DrawFormattedText()
是我在找的函数,但有人建议如何添加一个不是字符串的一部分的变量?
谢谢。
使用sprintf
到数据格式化成一个string
然后传递string
到DrawFormattedText
函数从Psychtoolbox这样的:
score = rand; % Random score value.
DrawFormattedText(win, sprintf('Your score: %d\n', score));