Preface xi be entation. ssible.with mo rial slowly and asa wernng a way as possible,with more specia ecialized topics comin as the chanters nued use of a style that worked well heforeintroducing a new problem or challer e presenting associated code and then presenting the output.In addition.as in the first edition.each chapter starts with a list of things to be done followed by commands that get them done.These start-of-chapter lists let you use the book as a reference once you understand the basics of MATLAB.Thus. after you have worked your way through the book.you will be able to turn to a section and quickly get the detailed information you need to complete the programming task you are undertaking.All the commands are listed as well in a single Command Index near the back of the book.another innovation of the second edition relative to the first. Another way we have made the text as user-friendly as possible is to update the website fo this book.On this site.you will be able to find and copy the programs and program outputs in this volume.The outputs on the website have color,motion,and sound,whereas those modalities are absent from the printed edition. As shown in the list o TLA the second edition ha a chapte on Psychtoolbo Thi L ing be ora Jon simply b or thei ppened.h wever,that in the Pen ep d Jon and Da nd.to their great d to prepare a chapter for th Brad'rea,the domain of which,it hap Psychtoolbox is d the st With his r scie was a computer science major as an under rad and did re arch in uter sei ence labs after completing his PhD at Haryard he proved to be a wonderful addition to the team His involvement in the book was limited to the one chapter he prepared,plus his review of this Preface,as per the agreement he made with Jon and David.Any errors in the book. then outside of the psychtoolbox chapter and the preface are not due to brad by the same token.any errors in the psychtoolbox chapter and in the preface are as much lon's and David's fault as they are,or might be,Brad's.In general,any mistakes rest squarely with Jon and David.or most especially David.who.after having had several vears to mull over the transition from the first edition to the second,should have gotten things right by now! The last thing we want to say in this preface echoes what we say in the main text about responsiveness to feedback.It is fine to be open to feedback from a computer,as we urge you to be,but it is also good to be open to feedback from people.If you spot something tha you think could be better,please let us know.If you have sugges ons for things to includ in a future dition,give us ose want he Ip with your prograr cannot s anding on th at last p ou with us.you can e of our e-mai thisPreface xi research; and (7) special tricks and new functions, developed or discovered since 2007, would be featured, including several developed by the authors to solve sometimes thorny problems that arise in data collection and data presentation. In preparing the second edition, Jon and David made these changes while retaining the main organization of the bookÊs first edition. As before, readers are ushered to the material slowly and in as a welcoming a way as possible, with more specialized topics coming as the chapters continue. Also as in the first edition, there is continued use of a style that worked well before·introducing a new problem or challenge, presenting associated code, and then presenting the output. In addition, as in the first edition, each chapter starts with a list of things to be done followed by commands that get them done. These start-of-chapter lists let you use the book as a reference once you understand the basics of MATLAB. Thus, after you have worked your way through the book, you will be able to turn to a section and quickly get the detailed information you need to complete the programming task you are undertaking. All the commands are listed as well in a single Command Index near the back of the book, another innovation of the second edition relative to the first. Another way we have made the text as user-friendly as possible is to update the website for this book. On this site, you will be able to find and copy the programs and program outputs in this volume. The outputs on the website have color, motion, and sound, whereas those modalities are absent from the printed edition. As shown in the list of new features, the second edition has a chapter on Psychtoolbox. This is a free, popular, MATLAB-based toolbox for running behavioral experiments. Neither Jon nor David had used Psychtoolbox before, simply because it wasnÊt essential for their work. It happened, however, that Brad Wyble, a newly hired faculty member in the Penn State Psychology Department (the department where David works), had extensive experience with Psychtoolbox. Jon and David invited Brad to prepare a chapter for the book on Psychtoolbox, and, to their great satisfaction, he agreed. BradÊs area of expertise is vision, the domain of behavioral science in which, it happens, Psychtoolbox is used the most. With his extensive background in computer science·Brad was a computer science major as an undergrad and did research in computer science labs after completing his PhD at Harvard·he proved to be a wonderful addition to the team. His involvement in the book was limited to the one chapter he prepared, plus his review of this Preface, as per the agreement he made with Jon and David. Any errors in the book, then, outside of the Psychtoolbox chapter and the Preface are not due to Brad. By the same token, any errors in the Psychtoolbox chapter and in the Preface are as much JonÊs and DavidÊs fault as they are, or might be, BradÊs. In general, any mistakes rest squarely with Jon and David, or most especially David, who, after having had several years to mull over the transition from the first edition to the second, should have gotten things right by now! The last thing we want to say in this preface echoes what we say in the main text about responsiveness to feedback. It is fine to be open to feedback from a computer , as we urge you to be, but it is also good to be open to feedback from people . If you spot something that you think could be better, please let us know. If you have suggestions for things to include in a future edition, give us those suggestions. If you want help with your programming, we cannot serve as consultants to you. We appreciate understanding on that last point. To get in touch with us, you can use one or more of our e-mail addresses: dar12@psu.edu, jaughan@ hamilton.edu, or bpw10@psu.edu. We hope you will find this book useful