Question: Given variable A that contains any vector or matrix, subtract 3 from it, and assign the result to variable B Examples: Input A = [8

 Given variable A that contains any vector or matrix, subtract 3from it, and assign the result to variable B Examples: Input A

Given variable A that contains any vector or matrix, subtract 3 from it, and assign the result to variable B Examples: Input A = [8 -3 0 8 7 -2] Output B = [5 -6 -3 5 4 -5] Input A = [9 0 1 -8 -6 -3] Output B = [6 -3 -2 -11 -9 -6] Function C Reset 1 function B = Decrement(A) %change the line below so that variable B is assigned the contents of A with 3 subtracted off of each element B = A; end Given variable g that contains a row vector of any size, assign to variable h the contents of g with the last element removed Examples: Input g = [8 1 -9] Output h = [8 1] Input g = [3 1 8 -4 0 6 -5] Output h = [3 1 8 -4 0 6] Function 1 function h = RowTrunc(g) %leave this line as is h = g; %Add a line of code below to change the contents of h, so that it contains the same elements end

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 Databases Questions!