Written specifically for those with no prior programming experience and minimal quantitative training, this accessible text walks behavioral science students and researchers through the process of programming using MATLAB. The book explores examples, terms, and programming needs relevant to those in the behavioral sciences and helps readers perform virtually any computational function in solving their research problems. Principles are illustrated with usable code. Each chapter opens with a list of objectives followed by new commands required to accomplish those goals. These objectives also serve as a reference to help readers easily relocate a section of interest. Sample code and output and chapter problems demonstrate how to write a program and explore a model so readers can see the results obtained using different equations and values. A web site provides solutions to selected problems and the book’s program code output and examples so readers can manipulate them as needed. The outputs on the website have color, motion, and sound.
Highlights of the new edition include:
•Updated to reflect changes in the most recent version of MATLAB, including special tricks and new functions.
•More information on debugging and common errors and more basic problems in the rudiments of MATLAB to help novice users get up and running more quickly.
•A new chapter on Psychtoolbox, a suite of programs specifically geared to behavioral science research.
•A new chapter on Graphical User Interfaces (GUIs) for user-friendly communication.
•Increased emphasis on pre-allocation of memory, recursion, handles, and matrix algebra operators.
The book opens with an overview of what is to come and tips on how to write clear programs followed by pointers for interacting with MATLAB, including its commands and how to read error messages. The matrices chapter reviews how to store and access data. Chapter 4 examines how to carry out calculations followed by a review of how to perform various actions depending on the conditions. The chapter on input and output demonstrates how to design programs to create dialogs with users (e.g., participants in studies) and read and write data to and from external files. Chapter 7 reviews the data types available in MATLAB. Readers learn how to write a program as a stand-alone module in Chapter 8. In Chapters 9 and 10 readers learn how to create line and bar graphs or reshape images. Readers learn how to create animations and sounds in Chapter 11. The book concludes with tips on how to use MATLAB with applications such as GUIs and Psychtoolbox.
Intended as a primary text for Matlab courses for advanced undergraduate and/or graduate students in experimental and cognitive psychology and/or neuroscience as well as a supplementary text for labs in data (statistical) analysis, research methods, and computational modeling (programming), the book also appeals to individual researchers in these disciplines who wish to get up and running in MATLAB.
"Finally, a definitive MATLAB textbook! The coverage of MATLAB programming is both broad and deep. This is the book that can help a motivated reader develop from a MATLAB beginner to a pro." – Hongjing Lu, University of California Los Angeles, USA
"Even without previous programming experience, students in behavioral sciences will find this book to be an accessible way to learn MATLAB because it is well-organized and has many examples, problems, and figures." – Russell M. Church, Brown University, USA
"This book has become a standard reference for our students in experimental psychology. The additional chapters in this second edition are especially useful for those who want to program experiments in cognitive psychology and psychophysics." – Rolf Ulrich, University of Tuebingen, Germany
"I have no hesitation in recommending the second edition of this excellent text on MATLAB for advanced students in experimental and cognitive psychology which will also serve as useful supplementary material for research methods and computational modeling courses." – Alan M. Wing, University of Birmingham, UK
"The book … covers exactly the material I’d want to be covered for an undergraduate or postgraduate student. … The level of writing is spot on for the intended audience. …The structure of the code + output examples is very effective in communicating the role and effect of the covered functions and operations. … The book serves a …valuable role in guiding MATLAB novices. …I can give [the book] to a new PhD student, post-doc, or RA, and they will quickly get up to speed with using MATLAB with little input required from me."– Simon Farrell, University of Bristol, UK
"A book of this content and profile is sorely needed. …Other books are not so easily accessible to non-programmers. …This book fills a void in that it brings in people to programming who never thought they would be able to program. That is a HUGE accomplishment. …I already recommended the book to several … graduate students and … they started learning and using MATLAB right away! …All changes are positive, and enrich the book immensely. …I welcome the new chapters, especially about GUIs and hardware-software connectivity." – Alen Hajnal, the University of Southern Mississippi, USA
1. Introduction 2. Interacting With MATLAB 3. Matrices 4. Calculations 5. Contingencies 6. Input-Output 7. Data Types 8. Modules And Functions 9. Plots 10. Lines, Shapes, and Images 11. Animation and Sound 12. Enhanced User Interaction 13. Psychtoolbox 14. Debugging 15. Going On