# Chapter 2

helloworld.m

temp.py

## Exercises

### 2.3.1 Basic Arithmetic

Convert the following equations into valid MATLAB or Python commands, and submit both the input and output of the command from the interpreter.

1. 2. 3. ### 2.3.2 Creating & Editing Matrices

Create the following matrices, and submit both the input and output of the command from the interpreter.

1. 2. 3. 4. For the following problems, create the matrices as described, and then edit as directed, and submit the editing command and the output from the interpreter.

1. Create the array , and replace the third element with the number 9.
2. Create the array , and replace the second element with the value in that location cubed. That is, cube the value found in that location and store it back in the same location.
3. Create the identity matrix and replace the element at location 2,3 with the number of elements in the identity matrix. Use the materials on the book website to download the data set necessary for these problems in either MATLAB or Python.

1. Load the chapter 2 data set from the zip file below (Chapter2.m or Chapter2.py). What is the value in variable “x”?
2. Clean out the variables in your Workspace or Variable Explorer. Load the chapter 2 data set. Modify the variable “z” to equal . Save the dataset, and submit.

Chapter 2Programs

Chapter 2 MATLAB code