2. Given the array A = [2 4 1; 6 7 2; 3 5 9]. Provide
appropriate the Matlab commands needed to
a. calculate the determinant of A
b. show the transpose of A
c. Calculate the trace of A
d. compute the sum over all rows of A
a. calculate the determinant of A det(A) b. show the transpose of A A' c. Calculate the trace of A trace(A) d. compute the sum over all rows of A sum(A(:))
In Python import numpy as np Given the array a = np.array([[1, 2, 3], [10, 20, 30], [100, 200, 300]]), compute and print the sums over all rows (should give [6, 60, 600]) the sums over all columns (the sum of he first column is 111) the maximum of the array the maxima over all rows the mean of the sub-array formed by omitting the first row and column the products over the first two columns (hint: look for an...
1. For a matrix 5 9 6 (1) Use Matlab command to calculate the transpose matrix (2) Use Matlab to calculate the determinant of the matrix (3) Justify if the matrix has the inverse matrix and use Matlab to calculate the inverse Matrix (4) Use Matlab to calculate the eignvalues and eignvectors of the Matrix
Given the matrix z = [1 5 3,2 4 6:6 9 31, what would be stored in sumofz after the following MATLAB command is executed? 33. sumofz sum (z) = a. 39 b. 9 18 12 c. 9 d. 9 12 18 e. none of the above 34. Suppose we had the two MATLAB commands below angls-[0: 0.1*pi: 2 pi] sines-sin(angles) What would be the command to plot angles on the x axis and sines on the y axis? a....
In Matlab Consider the array A. 10 3 5 -4 12 -5 9 2 A= 6 13 -8 11 115 -5 4 1 Write a program that computes the array B by computing the square of all the elements of A whose value is greater than 10 and multiplying 5 to each element that is less than or equal to 10. You need to use a logical array as a mask.
Solve in MATLAB Problem 3: Given the vector x- [2 1 0 6 2 3 5 3 4 1 3 2 10 12 4 2 7 9 2 4 51 use a for loop to (a) Add up the values of all elements in x (b) Compute the cumulative sum, y, of elements in x You can check your results using the built-in functions sum and cumsum. Q.5 What is the value of the sum of elements in vector x?...
In Matlab A= 3 -5 6 ( 15 7 9 13 5 -4 12 10 2 8 11 4 1 For the matrix A in problem-2, use MATLAB to carry out the following instructions a. Find the maximum and minimum values in each column. b. Find the maximum and minimum values in each row. c. Sort each column in ascending order and store the result in an array P. d. Sort each row in descending order and store the result...
***(unable to provide data except by using pictures) .2 6 9 3 8 3 2 1 5 5 4 9 9 9 4 5 7 5 4 7 82445538955922245 5 3 4 3 2 5 3 2 4 3 2 2 4 3 2 3 2 2 2 1 2 2 4 2 2 2 1 3 3 3 12 233 7 8 2 8 3 1 12111 2-21 1 382015785685 7 599231958 0 2 2 5 782 2990957503 1...
Use Matlab Given: x = [13, 5, 7, 9, 1, 4, 7, 10, 13] Use one 'for loop' to create the matrix y of dimension 5X2, using the index to program the address and the value of each element of y; and y = x' Given, x = [2, 3, 4, 5, 3, 4, 5, 6] Use two 'for loops' to create the matrix of dimension 4X2 Use a while statement to determine when the sum of the numbers in...
1. Given a set of numbers: A = {1, 3, 5, 2, 8, 7, 9, 4 }. Add each digit of your N-Number (e.g. N0 0 3 2 2 0 1 8) to each element of A separately to get your own final array B. ( e.g. B={1,3,8,4,10,7,10,12} = {B1,B2,B3,B4,B5,B6,B7,B8}. ) a) Your set B = ? b) Use merge-sort to sort the array B. Show each step. c) How many “comparisons” for each algorithm above? 2. Use binary-search for...
I have x=[1 ; 2 ; 4 ; 5 ; 7 ; 9 ; 3] can you write matlab code of column array that calculate midpoint between every two points. eg [(1+2)/2; (2+4)/2;(4+5)/2;(5+7)/2...] answer should give x_midpoint=[1.5 ; 3 ; 4.5 ; .....]