I would like to use Psychtoolbox for memory arithmetic tasks. I would like to show several numbers one by one on a screen ; after numbers presentation the subject need for example to make an addition of all seen numbers using a GUI dialog box. I would like that the subject see its answer in the screen to be sure he/she is in accordance with it. I am a new in PTB. Therefore, I had the idea to use the GUI of Matlab and combine it with PTB. It seems to be not a good idea, it doesn't work well.
I have found some functions like Ask or TwoStateQuery from PTB . However, these functions communicate with Matlab command and I prefer that the subject do not interact directly with the window command of Matlab.
Do you have any idea/suggestion how I can implement my arithmetic task?
NB: I would like to use Psychtoolbox because I use several other tasks as Stroop and Auditory Tone Discrimination already implemented in this software.
You would be able to do this pretty easily by just drawing text to the screen based on keyboard inputs like when you collect a standard response from participants.
I am not aware of a specific demo which does what you want included in the PTB distribution.
I have a bunch of demos here:
Again, none do precisely what you want, but all of the key techniques you need are demonstrated. Similarly, there will be numerous relevant demos in the PTB distribution e.g. KbDemo. This shows polling the keyboard and based in this updating something drawn to the screen.
This demo of mine would be relevant
Along with the text drawing demos.
I sometimes take suggestions for demos and make something for the demo site, but my time is very limited just now.
You might also want to search the forum. I am not up-to-date with all of the messages and it sounds like something which may have been asked and answered before.
Ask() and GetEchoString() will do that for you for strings, GetEchoNumber() will do it for only numbers.
cfe. around line 408 of BitsPlusIdentityClutTest.m for GetEchoString() or SuperShapeDemo.m for GetEchoNumber(). Or HDRTest.m for Ask().
One catch with current GetEchoNumber() is that it will use str2num() to convert strings into numbers, so if a subject would enter “2+5” it would return the number 7 as sum of 2+5, which may not be what you want. Using number = str2double(s); on the returned string s = GetEchoString() might be safer, if you want your subjects to do the math themselves.