subject

Create a new function file and write a function NewArray = ShiftRows_ubitname( OldArray ) that shifts the rows of an arbitrary 3-row array from rows arrangement 1, 2, and 3 to the arrangement 3, 1, and 2. For example, if the OldArray is [1 1 ; 2 2 ; 3 3], the NewArray is [3 3 ; 1 1 ; 2 2]. Your function calculations must do the following: Test that the number of rows in OldArray is 3 using an if-end structure. For any number of rows other than 3, the function must throw a message 'Number of rows in the input array must be 3' and assign a value of -1 of NewArray. Otherwise, the function must shift the rows of OldArray from 123 to 321 and assign it to NewArray. No looping is required. Contain the appropriate H1 and help text lines. Test your function in the command window as >> ShiftRows_ubitname( [1 1 ; 3 3] ) >> ShiftRows_ubitname( [1 1 ; 2 2 ; 3 3] )

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:00, lilkit
Is the following sentence true or false? during meiosis, the two alleles for each gene stay together.
Answers: 3
image
Computers and Technology, 22.06.2019 13:00, olorteguimikie
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 22.06.2019 17:30, jonquil201
Where would you click to edit the chart data?
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, jessisjawsome
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
You know the right answer?
Create a new function file and write a function NewArray = ShiftRows_ubitname( OldArray ) that shift...

Questions in other subjects: