Trying to Troubleshoot an Error Message

Hello! I have a code for a cognitive psychology experiment that was programmed in psych tool box; and when i try and open the experiment…i get the following error message in MATLAB:



Error in function OpenWindow: Invalid or missing Screen Number or Window Index

Error using Screen


Usage:


[windowPtr,rect]=Screen('OpenWindow',windowPtrOrScreenNumber [,color] [,rect][,pixelSize][,numberOfBuffers][,stereomode][,multisample][,imagingmode][,specialFlags][,clientRect][,fbOverrideRect]);


Error in function (line 27)

    [pms.wid, pms.wRect] = Screen('OpenWindow', 2, pms.backgroundColor); % open a psychtoolbox window



So because it tells me that there is an error at line 27 in the code… i look there and see the following:


 [pms.wid, pms.wRect] = Screen('OpenWindow', 2, pms.backgroundColor); % open a psychtoolbox window

 

…I have no idea  what to change here to make the code function properly. what i think the issue is though is that this code was programmed for windows, and now i am trying to operate it on mac. however, I dont know for sure. regardless, is there any way to make some modifications to have it operating on mac…i dont even know where to begin i have no background (very minimal) in computer science/ coding.


If anyone can help troubleshoot this it would be greatly appreciated! Please let me know if there is any additional info I should provide that would be helpful.


Thank you so much


~Maxine



thank you so much Mario !! I greatly appreciate your help...and yes thanks for the link to the beginners tutorial it will be my mission to learn this asap.
Thanks again
Kind Regards
~Maxine