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

Given the following MATLAB variables, determine by hand what appears in the Comm

ID: 3527786 • Letter: G

Question

Given the following MATLAB variables, determine by hand what appears in the Command Window as instructions a-e are followed sequentially. What are the final values of all the variables? Generate the MATLAB commands that follow the instructions. To submit this assignment, enter the arrays & your commands into one M-file. Do not submit your hand work; bring it to discussion. Remove the 1st column of A Append the values b/3 to the end of array c Square the last two values in array c Insert the minimum value in c as the 1st row of b Find the sum of all the elements of A, store the result into mysum

Explanation / Answer

clear all; clc; A=[7,4,-6;10,-8,-2] b=[-3;9] c=[1,8,4,3] %remove 1st col of A A=A(:,2:end) %Append values b/3 to end of array c c(end+1)=b(1,1)/3 c(end+1)=b(2,1)/3 %square last 2 values in array c c(end-1:end)=c(end-1:end).^2 %insert mininum value in c as 1st row of b b(1)=min(c) mysum=sum(sum(A))

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