Question: Question 3: 18 marks & Write a Matlab/Octave command to produce a row vector, xx, which starts from 2 and finishes at 20. The step
Question 3: 18 marks & Write a Matlab/Octave command to produce a row vector, xx, which starts from 2 and finishes at 20. The step size is given as 1.5. (Note: You are not allowed to type all elements of the vector) b. Given row vectors B=(2,4,8,10 and C=11,3,5,7). Write a Matlab/Octave command to multiply B and C. Store the results in vector A. c. K is a 3 by 4 matrix. Write a Matlab/Octave command to determine the average value of all elements in the second column of matrix K. Store the result in a variable known as AVG d. Mis a 3 by 2 matrix. Write a Matlab/Octave command to determine the sum of all elements in row I and row 3 of matrix M. Store the result in a variable known as Total. Question 4: 17 marks The table below gives the average speed and distance travelled by three motorcycles Motoreyele 1 2 3 60 50 80 Average speed, u (km/h) Distance travelled, s (km) 120 125 100 Write Matlab/Octave codes to: a assign the values to the vectors u ands b. determine and display: i the time of travel, t for each of the three motorcycles ii. the longest average time of travel and the motorcycle iii the shortest average time of travel and the motorcycle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
