Preface when it does something that,to your knowledge,has not been done before,can let you feel rightly proud of your achievement. There are many computer programming languages.Why is this book about MATLAB? MATLAB(short for Matrix Laboratory),is a commercial product of a company called The Math Works (Natick.Massachusetts).for which we authors do not work and have no com mercial connection.The following.therefore,can be taken as our honest opinion of their product:MATLAB is a simple yet powerful language for computer programming.It has an active community of users,engaged in many branches of science and engineering.One of M s m ractive igh-level comm lations with large as well as sm d fo ngpublic AB e collectio or the pr on of espo platf .runs o Cs.Ma ng ntist vith in oth is have therefor MATLAB ing to the hea alth an it is to learn matlab in the futu e.You will be art of thatacti ou choose to dive into the material provided here How did it come to n ss that there is a second edition of this book?As is always true of a second edition,its predecessor was successful enough to keep the work alive.but changes in the field suggested a face-lift was needed.Among the needed changes was the appear- ance of other MATLAB books for psychologists and neuroscientists(Fine Boynton. 2013:Madan,2014:Wallisch et al.2009).which are welcome additions.though they are different in style,tone,level of coverage,and organization from the first edition of this book(but not so perfect,in our view,that they obviate this second edition). As the author of the first edition (Rosenbaum,2007)contemplated the second edition,he realized that the process of revising and updating the book would benefit from the involve- ment of his long-time friend and collaborator,Jonathan Vaughan,the James L.Ferguson Professor of Psychology and Neuroscience at Hamilton College.Jon has decades of experi- ence with computer programming.He has served as the editor of Behavior Research Meth wed publication of the Psychonomic Society irst a hor bas AB from Jon.He continued to leamn from Jon in an【 map out the ways the e sec ong th ag o we (1)All kn errors in the e firstediti would b cted more gging;G ic AB (4 blems woulda with do n the hook's com/780415535946)rather than in the back of the book to allow for mor pdating of the nd additio eds and 5h ould he a tutorial on designing gra GUIs,which enable a user to interact with a program using g within MATLAB:(6)there would be a tutorial in designing experiments using Psychtool- box,a freely available MATLAB toolbox that is specifically geared to behavioral science x Preface when it does something that, to your knowledge, has not been done before, can let you feel rightly proud of your achievement. There are many computer programming languages. Why is this book about MATLAB? MATLAB (short for Matrix Laboratory), is a commercial product of a company called The MathWorks (Natick, Massachusetts), for which we authors do not work and have no commercial connection. The following, therefore, can be taken as our honest opinion of their product: MATLAB is a simple yet powerful language for computer programming. It has an active community of users, engaged in many branches of science and engineering. One of MATLABÊs most attractive features is that it offers high-level commands for performing calculations with large as well as small data sets and for generating publication-quality graphics. Another attraction of MATLAB is that it allows for the presentation of stimuli and the collection of responses with precise timing. Yet another attraction is that MATLAB is platform-independent. It runs on PCs, Macs, and Linux machines. For these and other reasons, MATLAB is a very good language for behavioral scientists. A growing number of behavioral scientists, along with neuroscientists, engineers, and investigators in other disciplines, have therefore chosen to learn MATLAB. Owing to the health and vitality of the MATLAB programming community, it is likely that more and more people will want to learn MATLAB in the future. You will be part of that active community if you choose to dive into the material provided here. How did it come to pass that there is a second edition of this book? As is always true of a second edition, its predecessor was successful enough to keep the work alive, but changes in the field suggested a face-lift was needed. Among the needed changes was the appearance of other MATLAB books for psychologists and neuroscientists (Fine & Boynton, 2013; Madan, 2014; Wallisch et al., 2009), which are welcome additions, though they are different in style, tone, level of coverage, and organization from the first edition of this book (but not so perfect, in our view, that they obviate this second edition). As the author of the first edition (Rosenbaum, 2007) contemplated the second edition, he realized that the process of revising and updating the book would benefit from the involvement of his long-time friend and collaborator, Jonathan Vaughan, the James L. Ferguson Professor of Psychology and Neuroscience at Hamilton College. Jon has decades of experience with computer programming. He has served as the editor of Behavior Research Methods, Instruments, & Computers , a peer-reviewed publication of the Psychonomic Society. The first author basically learned MATLAB from Jon. He continued to learn from Jon in preparing this second edition. When Jon agreed to join in, he and David began to map out the ways the second edition would differ from the first. Among the things they agreed to were the following: (1) All known errors in the first edition would be corrected; (2) more would be said about debugging; (3) more problems would be given, including problems that would help students confront very basic issues in the rudiments of MATLAB; (4) solutions to selected problems would appear with downloadable code on the bookÊs new website ( www.rout ledge.com/9780415535946 ) rather than in the back of the book to allow for more extensive code, updating of the programs if necessary, and addition of new programs as needs and curiosities arose; (5) there would be a tutorial on designing Graphical User Interfaces, or GUIs, which enable a user to interact with a program using graphics to run experiments within MATLAB; (6) there would be a tutorial in designing experiments using Psychtoolbox, a freely available MATLAB toolbox that is specifically geared to behavioral science