To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
This textbook introduces the fundamentals of MATLAB for behavioral sciences in a concise and accessible way. Written for those with or without computer programming experience, it works progressively from fundamentals to applied topics, culminating in in-depth projects. Part I covers programming basics, ensuring a firm foundation of knowledge moving forward. Difficult topics, such as data structures and program flow, are then explained with examples from the behavioral sciences. Part II introduces projects for students to apply their learning directly to real-world problems in computational modelling, data analysis, and experiment design, with an exploration of Psychtoolbox. Accompanied by online code and datasets, extension materials, and additional projects, with test banks, lecture slides, and a manual for instructors, this textbook represents a complete toolbox for both students and instructors.
This article presents an innovative workflow for the acquisition and storage of archaeological data. The system is based on open-source software to enhance method replication and media accessibility. QGIS software is used as the central platform, connected to a spatial database developed in PostgreSQL and managed with the SQL and Python programming languages. The aim is to achieve an efficient, flexible, and reproducible digital method for data collection and management that can be applied to surface archaeological surveys. During the implementation and development of the method, we have recorded over 4,600 archaeological remains in two different structures with traces of Upper Paleolithic activity in the Lower Gallery of La Garma (Cantabria, Spain). After 18 months of continuous work, the results obtained demonstrate the usefulness and versatility of this procedure, which can be adapted to each context and to the specific needs of each researcher. Our goal is not simply to systematize archaeological documentation, as traditionally proposed, but to establish a simple and robust method for data collection and preservation, accessible to any user. Its fully open-source approach aims to promote a model that is nurtured by the use and contributions of the research community.
Chapter 13 presents the second application of MATLAB to behavioral sciences: data analysis. Students review previously-learned data structures often encountered in practice before applying their programming knowledge from Chapters 1 to 11 to manage each. Starting with tabular data, tables from Chapter 8 are reviewed, with students learning common data science tasks for managing one or more tabular data sets, before applying their knowledge to real experimental data. Next, hierarchical data are reviewed, connecting students’ knowledge of structure arrays from Chapter 8 to a popular internet-based data format (JSON), with students applying their newfound knowledge to analyze data on the behavior of European monarchs.
Chapter 4 introduces students to logical values, a simple data type that can only take values of one and zero. While simple, logical values are essential components of program flow (conditionals, loops) which they will learn next, so mastery of them is essential before tackling those more difficult tools. Logical values can also be used to subset arrays according to their values, making them critical for complex data management tasks. Students new to programming are often unfamiliar with operations that create logical values, or which operate on logical values, so this chapter provides detailed explanations and examples to familiarize students with this new and valuable data type.
Chapter 12 presents the first application of MATLAB to behavioral sciences: modeling behavioral phenomena using MATLAB. Students learn basic computational modeling principles before applying their programming knowledge from Chapters 1 to 11 to model two types of behavior. First, classical conditioning is modeled using the Rescorla-Wagner model, which is used to make predictions about how an organism will react to multiple stimuli when presented together, such as in the classic case of Pavlov’s dog who was trained to salivate to the sound of a bell. Next, foraging behavior in animals is modeled, wherein agents forage for food on patches of resources, learning from experience when to exploit their current patch or explore in search of more food.
Chapter 3 introduces students to functions, which rapidly expands what they can do with MATLAB. For new programming students, this section begins with the underlying computer science principles of inputs and outputs, drawing connections to the same concepts in math. MATLAB functions are highly flexible in how they handle inputs and produce outputs, and this chapter explains those nuances in detail, using several often-used functions as examples. MATLAB also has special function features including multiple outputs and a unique syntax for functions which use text; as with input flexibility, the textbook explains their use and provides often-used example functions.
Chapter 8 further develops students’ understanding of data structures by introducing several new ones. Higher-dimensional arrays are generalizations of the arrays they learned in Chapter 2, but can be hard to visualize because we live in a three-dimensional world, and this chapter includes several suggestions for managing higher-dimensional data. Cell arrays and structure arrays can store any data type, and students learn the unique syntaxes needed to manage this flexibility. Tables store spreadsheet-type data, which students are introduced to formally, while also learning the many indexing and display features that make this data type critical for data analysis. Multiple function outputs from Chapter 3 are introduced as their own data type with additional tricks for managing them. The chapter concludes with general tools for learning the structure of any MATLAB data type and the methods available for using it.
Chapter 5 introduces perhaps the most difficult tools for new programmers to grasp, namely conditionals and loops, which control when, whether, and how often code executes. Presentation of conditionals and loops begins with descriptions of what they do: conditionals control whether code runs, or which piece of code runs from multiple options; while loops make code run repeatedly, either “while” some condition is met (“while” loops) or “for” each element of a set of values (“for” loops). This presentation makes clear to students how to translate these descriptions into MATLAB code, allowing them to see the correspondences between the broader programming task and the tools that accomplish them. Syntax is explored in detail, including common pitfalls and specification errors. Lastly, syntax for interrupting loops and changing their operation is presented, furthering students’ mastery of these critical tools.
Chapter 1 introduces students to MATLAB. Beginning with basic computer science concepts, the student is introduced to how computers work generally, and then to the MATLAB interface itself, instructing students on key buttons, tabs, and windows that they will use virtually every time they open MATLAB. The structure of writing code is introduced, wherein code can be tested in the console (Command Window in MATLAB) but ultimately should be stored and saved in scripts for later re-use. Students learn the basic variable operations: creation and modification (assignment) and later use (reference), and are introduced to the utility of these ubiquitous programming tools, Basic script structure and formatting is introduced, including how to create, modify, and use variables and add comments to their code. The chapter concludes with how to obtain help and access documentation from within MATLAB.
Chapter 14 presents the third application of MATLAB to behavioral sciences: conducting computerized experiments. Students learn basic experimental design before applying their programming knowledge from Chapters 1 to 11 to develop three experiments: the Flanker and N-Back tasks, and the Monty Hall probability puzzle. In the final, longest section of this chapter, students learn how to use the MATLAB add-on Psychtoolbox, which allows full control of and interaction with the screen, keyboard, mouse, and audio systems. The three experiments from earlier in the chapter are extended to incorporate Psychtoolbox functionality, and a new experiment, the Stroop task, concludes the chapter.
Chapter 9 returns to computer science concepts from Chapter 1 and prepares students for subsequent chapters with detailed instructions for loading and saving data. A crucial component is an understanding of paths, which determine where information is stored on a computer and how to access it when needed. MATLAB has many methods for working with paths, many of which work predictably by default, and each is discussed in turn with its costs and benefits, with emphasis on the easiest way to work with multiple files: storing them all in the same place. Equipped with knowledge of data structures from Chapters 2, 4 and 8, this chapter discusses how to load and save each type of data, both in the native MATLAB data format and in formats other programs use or produce.
Chapter 2 introduces students to the basic building blocks of MATLAB data: arrays. Types of arrays are disambiguated based on their structure into scalars, which are individual values students are familiar with from mathematics, and vectors and matrices, which are often new to students. These concepts are introduced as arrangements of numbers: larger arrays are built from smaller arrays via concatenation, and can be subsetted into smaller arrays via indexing. Importantly, no linear algebra is taught or required in this section, as most behavioral science students do not come in with this knowledge, nor do most applications require it. Instead, the emphasis is on arithmetic operations students will be using most often.
Chapter 11 teaches students how to make graphs in MATLAB. Specifically, students learn to make line graphs, scatterplots, bar graphs, and histograms, four basic and essential visualizations for anyone interested in presenting data. New data types are needed, building on knowledge from Chapter 2 and Chapter 8 to reinforce understanding, and new aspects of the MATLAB interface for graphs are introduced in detail. MATLAB has many ways to customize graphs, each of which is reviewed in turn, along with its strengths and weaknesses. To help students make the most of MATLAB graphics infrastructure, its hierarchical structure is explained in detail, allowing students to modify any graphics feature, using any other graphics feature as a starting point. Critically, this chapter elaborates on how to use MATLAB documentation to identify and specify the graphics features they want to modify, while providing many examples of such modification using different syntax.
Chapter 10 expands on the discussion of functions from Chapter 3, teaching students how to write their own functions. MATLAB has many types of functions and methods for accessing and storing functions, and each is discussed in turn, starting from the simplest and concluding with compositions of multiple functions. Knowing how to ensure MATLAB uses user-defined functions is essential, and knowledge of loading and saving data from Chapter 9 is reiterated and expanded upon to ensure MATLAB can use the functions students write. Returning again to Chapter 3, this chapter teaches students how to incorporate the flexibility of MATLAB function syntax into their own code.
Chapter 7 builds on students’ understanding of arrays and numeric and logical data types from Chapters 2 and 4, demonstrating how to use what they already know to manipulate text in MATLAB. Text in MATLAB comes in two forms: character arrays, in which text is stored in individual letters, numbers, symbols, and spaces; and strings, in which each element of text can store any number of those characters. Differences in the utility of these structures for different tasks are discussed, as is their interchangeability when providing inputs to other MATLAB functions. Once text is introduced, students learn to interface with MATLAB via input/output features, both in the console and in pop-up windows. Lastly, because MATLAB code is also text, students learn to run text as MATLAB code, as well as potential issues with doing so and workarounds to avoid those issues.
Situates the original 1913 production of Sergei Diaghilev’s The Rite of Spring in its local theatrical context, exploring the scheduling and significance of the ballet within the Parisian calendar. Recounts the popular reception of the Ballets Russes’s annual ‘Saisons Russes’ in the French capital, focusing on the pre-war period but also offering a broader history of the troupe and its activities until its dissolution in 1929. Describes the principal stylistic characteristics of the troupe’s productions in terms of music, choreography and visuals (decors and costumes), suggesting historical developments and trajectories that aligned with broader strands of cultural influence during the first decades of the twentieth century. Also explores the nineteenth-century background of theatrical dance in Russia and Western Europe.
Antenatal steroids (ANS) are one of the most widely prescribed medications in pregnancy, being administered to women at risk of preterm delivery. In the setting of preterm delivery at or below 35 weeks’ gestation, systematic review data show ANS reduce perinatal morbidity and mortality, primarily by promoting fetal lung maturation. However, with the expanding use of this intervention has come a growing appreciation for the potential off-target, adverse effects of ANS therapy on wider fetal development. We undertook a narrative literature review of the animal and clinical literature to assess current evidence for adverse effects of ANS exposure and fetal development. This review presents a summary of the evidence relating to the potential for wide-ranging, off-target, adverse effects of ANS therapy on fetal development and programming. We highlight an urgent need for further animal and clinical studies investigating the effects of ANS on the fetal immune, cardiovascular, renal and hepatic systems given a current sparsity of evidence. We also strongly suggest an emphasis on open disclosure, discussion and education of clinicians and patients with regard to the potential benefits and risks of ANS therapy, particularly in late preterm and term gestations where infants derive relatively few benefits from these drugs. We also propose further studies on the optimisation of ANS therapy through improved patient selection and improved dosing regimens based on a pharmacokinetic-pharmacodynamic informed understanding of ANS action on the fetal lung.
Chapter 5 focuses on sonification, which is a developing method with great opportunities and potential to be used in participatory research with adolescents. Sonification can be particularly useful and complementary to more traditional visual methods for data sharing and dissemination. The downside is the need for specific software and knowledge on programming; however, new methods less reliant on technology are slowly changing sonification and being used in more settings.
Network science is a broadly interdisciplinary field, pulling from computer science, mathematics, statistics, and more. The data scientist working with networks thus needs a broad base of knowledge, as network data calls for—and is analyzed with—many computational and mathematical tools. One needs good working knowledge in programming, including data structures and algorithms to effectively analyze networks. In addition to graph theory, probability theory is the foundation for any statistical modeling and data analysis. Linear algebra provides another foundation for network analysis and modeling because matrices are often the most natural way to represent graphs. Although this book assumes that readers are familiar with the basics of these topics, here we review the computational and mathematical concepts and notation that will be used throughout the book. You can use this chapter as a starting point for catching up on the basics, or as reference while delving into the book.
This Element offers intermediate or experienced programmers algorithms for Corpus Linguistic (CL) programming in the Python language using dataframes that provide a fast, efficient, intuitive set of methods for working with large, complex datasets such as corpora. This Element demonstrates principles of dataframe programming applied to CL analyses, as well as complete algorithms for creating concordances; producing lists of collocates, keywords, and lexical bundles; and performing key feature analysis. An additional algorithm for creating dataframe corpora is presented including methods for tokenizing, part-of-speech tagging, and lemmatizing using spaCy. This Element provides a set of core skills that can be applied to a range of CL research questions, as well as to original analyses not possible with existing corpus software.