Scale Slider

Hi there,


I am just wondering whether it is possible to create a Scale Slider in PTB, just like you can using the GUI interface in MatLab.


I want to measure confidence on a scale of 1 to 10 using a scale slider following a response to a stimulus, with the participants able to see the value of their response on the scale. 


Any suggestions as to how best to do this would be very much appreciated.


Best,


Will

Hi there,

I actually wrote a code snippet to do exactly this, based on someone else's code I found online. It wouldn't be hard to turn this into a function that returns a value.


You can make the values anything you like, and the text anything you like - should be fairly obvious.

Hope this helps!

Cheers

Deborah.



wdedoncker93@... [PSYCHTOOLBOX] wrote:

Hi there,


I am just wondering whether it is possible to create a Scale Slider in PTB, just like you can using the GUI interface in MatLab.


I want to measure confidence on a scale of 1 to 10 using a scale slider following a response to a stimulus, with the participants able to see the value of their response on the scale.


Any suggestions as to how best to do this would be very much appreciated.


Best,


Will


--
Deborah Apthorp
NHMRC Early Career Fellow
Research School of Psychology
Australian National University
ACT 2601

ph. (02) 6125 9631
Hi Deborah,

Thank you very much for that! Some minor alterations and that should do exactly what I want it to do.

Once again thank you for your help.

Cheers,

Will

Hey all,

Not directly PTB related but since sliders were mentionned, I think this is worth having a look at.

The Effect of Visual Appearance on the Performance of Continuous Sliders and Visual Analogue Scales

https://www.youtube.com/watch?v=vxV0rV9LX_U

Best

Remi


On 25/11/16 21:40, Deborah Apthorp deborah.apthorp@... [PSYCHTOOLBOX] wrote:
Hi there,

I actually wrote a code snippet to do exactly this, based on someone else's code I found online. It wouldn't be hard to turn this into a function that returns a value.


You can make the values anything you like, and the text anything you like - should be fairly obvious.

Hope this helps!

Cheers

Deborah.



wdedoncker93@... [PSYCHTOOLBOX] wrote:
 

Hi there,


I am just wondering whether it is possible to create a Scale Slider in PTB, just like you can using the GUI interface in MatLab.


I want to measure confidence on a scale of 1 to 10 using a scale slider following a response to a stimulus, with the participants able to see the value of their response on the scale. 


Any suggestions as to how best to do this would be very much appreciated.


Best,


Will


--
Deborah Apthorp
NHMRC Early Career Fellow
Research School of Psychology
Australian National University
ACT 2601

ph. (02) 6125 9631

1 Like
Hi Deborah,

Sorry again, I am relatively new to PTB and trying to get a protocol running. Any suggestions as to how I could get the value returned and displayed on the screen while someone is moving the scale slider along the line?

Thanks for the help,

Will
Hi Will,

OK, here is some slightly updated code that includes the current rating displayed on the screen. You really just needed 2 extra lines: one to work out the current rating, and one to display the text on the screen:

currentRating = ((LineX - xCenter) + 250)/50; % for a rating of between 0 and 10. Tweak this as necessary.
DrawFormattedText(w, num2str(currentRating) ,'center', (yCenter-200), textColor, [],[],[],5); % display current rating (to make this display whole numbers, use "round(currentRating)"

But I made the code a bit nicer so you can enter your own instructions and anchors for the scale at the top.

Cheers!

Deborah.



wdedoncker93@... [PSYCHTOOLBOX] wrote:

Hi Deborah,


Sorry again, I am relatively new to PTB and trying to get a protocol running. Any suggestions as to how I could get the value returned and displayed on the screen while someone is moving the scale slider along the line?

Thanks for the help,

Will

--
Deborah Apthorp
NHMRC Early Career Fellow
Research School of Psychology
Australian National University
ACT 2601

ph. (02) 6125 9631
Deborah, 

You are a legend! That works perfect, thank you very much for all your help. 

Cheers,

Will

Hi Deborah,

I know its been awhile since you originally posted this but I’m looking for a similar function as Will described. For some reason I am unable to see the code you shared so I was wondering if you wouldn’t mind posting it again or sharing privately? Thanks!

Cheers
Michael

Hey Deborah,

I know this is quite some time ago, but I’d be very interested in the code as well since I want to implement a continuous scale in my experiment. Is there any way you could the lines again?

Best,
Antonia

Hi there,
Same question. Would you be able to share that code?
Thanks
Pauline

It is probable that Deborah Apthorp doesn’t read this forum, so you should try to contact her directly to share her code again, ideally re-uploading it here so others can use it…

1 Like