Determine the size and contents of the following arrays. Note that the later arrays may depend on the definitions of arrays defined earlier in this exercise. a. \(a=1: 2: 5\); b. \(b=\left\\{a^{+} a^{*} a^{*}\right\\}\) c. \(c=b(1: 2: 3,1: 2: 3)\); d. \(d=a+b(2,:)=\) c. \(w=\) [zeros \((1,3)\) ones \((3,1), 3: 5^{*}\) ? f. \(b([1] 3], 2)=b([3,1], 2)=\)

Short Answer

Expert verified
In summary: - Array \(a = [1, 3, 5]\) - Array \(b = [+1, +3, +5, -1, -3, -5, -1, -3, -5]\) - Array \(c = \begin{bmatrix}1 & 3 & 5\\ -1 & -3 & -5\\ -1 & -3 & -5\end{bmatrix}\) - Array \(d = [0, 0, 0]\) - Array \(w = \begin{bmatrix}0 & 0 & 0 & 1 & 3 & 3+\sqrt{5} & 5\end{bmatrix}\) - Arrays b([1] 3], 2) and b([3, 1], 2) are equal to \([3, -3]\) and \([-3, 3]\), respectively.

Step by step solution

01

2a. Analyze Array a

Array a is defined as a range of elements from \(1\) to \(5\) with increments of \(2\): \(a = 1:2:5\)
02

2b. Calculate and Construct Array a

To construct array a, let's start with the first element which is \(1\) and increment it by \(2\). 1. \(a(1) = 1\) 2. \(a(2) = a(1) + 2 = 3\) 3. \(a(3) = a(2) + 2 = 5\) So, array a is: \[a = [1, 3, 5]\]
03

2c. Analyze Array b

Array b is defined as \(\{a^{+} a^{*} a^{*}\}\), which is a different combination of operations on array a.
04

2d. Calculate and Construct Array b

To find array b, we concatenate positive and negative elements of array a twice. \(b = [+1, +3, +5, -1, -3, -5, -1, -3, -5]\)
05

2e. Analyze Array c

Array c is a sub-array of b obtained by taking elements in the positions from the first to the third, with increments of 2, and stacking them as rows: \[c = b(1:2:3, 1:2:3)\]
06

2f. Calculate and Construct Array c

To create array c, let's take elements of array b at the positions we calculated above and stack them as rows: \(c = \begin{bmatrix}b(1) & b(2) & b(3)\\ b(1+2) & b(2+2) & b(3+2)\\ b(1+4) & b(2+4) & b(3+4)\end{bmatrix} = \begin{bmatrix}1 & 3 & 5\\ -1 & -3 & -5\\ -1 & -3 & -5\end{bmatrix}\)
07

2g. Analyze Array d

Array d is a sum of two arrays: the elements in the second row of array b, and array a itself: \(d = a + b(2, :)\)
08

2h. Calculate and Construct Array d

To find array d, let's add the second row of array b to array a: \(d = [1, 3, 5] + [-1, -3, -5] = [0, 0, 0]\)
09

2i. Analyze Array w

Array w is created by concatenating three different arrays: 1. A 1 by 3 matrix filled with zeros, denoted as zeros(1,3) 2. A 3 by 1 matrix filled with ones, denoted as ones(3,1) 3. The range from \(3\) to \(5^{*}\)
10

2j. Calculate and Construct Array w

Array w is a concatenation of three different arrays: 1. zeros(1,3) = \(\begin{bmatrix}0 & 0 & 0\end{bmatrix}\) 2. ones(3,1) = \(\begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix}\) 3. The range from \(3\) to \(5^{*}\), which means we start with 3 and increment by \(\sqrt{5}\). \(w = \left[ \begin{bmatrix}0 & 0 & 0 \end{bmatrix}, \begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix}, \begin{array}{c}3 \\ 3 + \sqrt{5} \\ 5\end{array} \right] = \begin{bmatrix}0 & 0 & 0 & 1 & 3 & 3 + \sqrt{5} & 5\end{bmatrix}\)
11

2k. Analyze Arrays b([1] 3], 2) and b([3, 1], 2)

We need to find elements of array b, with the positions specified, and create two new arrays based on these elements.
12

2l. Calculate and Construct Arrays b([1] 3], 2) and b([3, 1], 2)

Using elements of array b, let's calculate and construct the required arrays: 1. b([1] 3], 2) = \([b(1, 2), b(3, 2)] = [3, -3]\) 2. b([3, 1], 2) = \([b(3, 2), b(1, 2)] = [-3, 3]\)

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Solve the following system of simultaneous equations for \(x\). \(-2.0 x_{1}+5.0 x_{2}+1.0 x_{3}+3.0 x_{4}+4.0 x_{5}-1.0 x_{6}=0.0\) \(2.0 x_{1}-1.0 x_{2}-5.0 x_{3}-2.0 x_{4}+6.0 x_{5}+4.0 x_{6}=1.0\) \(-1.0 x_{1}+6.0 x_{2}-4.0 x_{3}-5.0 x_{4}+3.0 x_{5}-1.0 x_{6}=-6.0\) \(4.0 x_{1}+3.0 x_{2}-6.0 x_{3}-5.0 x_{4}-2.0 x_{5}-2.0 x_{6}=10.0\) \(-3.0 x_{1}+6.0 x_{2}+4.0 x_{3}+2.0 x_{4}-6.0 x_{5}+4.0 x_{6}=-6.0\) \(2.0 x_{1}+4.0 x_{2}+4.0 x_{3}+4.0 x_{4}+5.0 x_{5}-4.0 x_{6}=-2.0\)

Assume that array array 1 is defined as shown, and determine the contents of the following sub-arrays. $$ \operatorname{array} 1=\left[\begin{array}{rrrrr} 1.1 & 0.0 & 2.1 & -3.5 & 6.0 \\ 0.0 & 1.1 & -6.6 & 2.8 & 3.4 \\ 2.1 & 0.1 & 0.3 & -0.4 & 1.3 \\ -1.4 & 5.1 & 0.0 & 1.1 & 0.0 \end{array}\right] $$ a. array \(1(3,4)\) b. array \(1(:, 3)\) c. arxay \(1\left(1: 2: 3,\left[\begin{array}{lll}3 & 3 & 4\end{array}\right]\right)\) d. array \(1(\\{1 \quad 1], 4)\)

Use the MATLAB Help Browser to find out how to create a new directory from within MATLAB. Then, create a new directory called mymewdir under the current directory, Add the new directory to the top of MATLAB's path.

Use MATLAB to evaluate cach of the following expressions. a. \((3-5 i)(-4+6 i)\) b. \(\cos ^{-1}(1.2)\)

Change the current directory to mynewdir. Then open an Edit Window and add the following lines: 8\. Create an input array from \(-2\) *pi to 2 *pi \(t=-2 * \mathrm{pi}: \mathrm{p} i / 10: 2^{\circ} \mathrm{pi}\); of Calculate |sin(t)| \(x=a b s(\sin (t))\); \- Plot result plot \((t, x)=\) Save the file with the name test2. \(m\), and execute it by typing test 2 in the Command Window. What happens?

See all solutions

Recommended explanations on Psychology Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free