Question: Exercise 1 Here are the matrices, A , B , and C: 2 6 - 2 8 7 - 1 1 3 1 8 9

Exercise 1
Here are the matrices, A, B, and C:
2
6
-2
8
7
-11
3
18
9
A
2
-4
-2
8
5
-11
3
-2
9
B
14
3
-2
6
3
17
-4
7
3
C
Using logical indexing, do the following:
Double all elements in A that are less than 5.
Set all matrix elements in B to their absolute value. (Hint: select only the negative elements and multiply them by -1.)
Identify the locations in A that are greater than 1; set all matrix elements in C that are in the same locations to be 0.
Each of these operations should only require one line of code (though you can also do them with multiple lines and an intermediate variable for the indexing result if you want to).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!