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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
Events and conditions that happen within an organization that are somewhat easier to deal with when responding to change are called
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
question
Computers and Technology, 23.06.2019 22:30
The output voltage of a power supply is assumed to be normally distributed. sixteen observations are taken at random on voltage are as follows: 10.35, 9.30, 10.00, 9.96, 11.65, 12.00, 11.25, 9.58, 11.54, 9.95, 10.28, 8.37, 10.44, 9.25, 9.38, and 10.85
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
How can smart devices benefit businesses, organizations, and social communities in the global marketplace?
Answers: 1
You know the right answer?
Create a new function file and write a function NewArray = ShiftRows_ubitname( OldArray ) that shift...
Questions
question
Mathematics, 04.10.2021 06:30
question
Mathematics, 04.10.2021 06:30
question
Physics, 04.10.2021 06:30
question
English, 04.10.2021 06:30
question
Mathematics, 04.10.2021 06:40
question
Mathematics, 04.10.2021 06:40
question
Physics, 04.10.2021 06:40
Questions on the website: 13722363