Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions