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));