Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a vectors called myvec1, myvec2, and myvec3, ranging from 2 to 5 in incre

ID: 3890663 • Letter: C

Question

Create a vectors called myvec1, myvec2, and myvec3, ranging from 2 to 5 in increments of 0.5 using three methods: a. Specify each value explicitly. b. Use colon () notation. c. Use the built-in MATLAB function linspace. Create a column vector containing the integers 1 to 5 by specifying each value explicitly creating a row vector using any of the methods in prob. 1 and transposing it a. b. Perform the following matrix operations in order: a. Create the following 3x4 matrix and assign it to the variable name mymat; l3.1 3.1 4.1 5.2.6.2 7.2 8.2 3.9.3 3.7 3.6 b. Multiply every element of the matrix by 2, store the result back into mvmat c. Set the element in the third row and the second column to the value 0 d. Divide the third column by 1.5. Create a 3x3 magic square and store it in the variable a. Set the matrix b equal to a. Use matrix multiplication to multiply a times b, store the result in the variable matmult. a. b. Multiply a times b element-by-element, store the result in the variable elem.mult

Explanation / Answer

myvec1=[2 2.5 3 3.5 4 4.5 5]%1
myvec2=2:0.5:5
myvec3=linspace(2,5,7)


colvec1=[1;2;3;4;5]   %2
rowvec2=[1 2 3 4 5]
colvec2=rowvec2'

mymat=[1.1 2.1 3.1 4.1; 5.2 6.2 7.2 8.2;3.9 3.8 3.7 3.6]
mymat=2*mymat
mymat(3,2)=0
A=mymat(:,3)/1.5

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote