Question: 2 y Section 3 . 4 - CMPSC 2 0 0 : Prog x C . Construct an indexing array inc arnzybooks.com / zybook /

2y Section 3.4- CMPSC 200: Prog x
C.
Construct an indexing array inc
arnzybooks.com/zybook/PSUBehrendCMPSC200GongSpring2024/chapter/3/section/4
Poker just got bette... zy zyBooks - My librar...
y library > CMPSC 200: Programming for Engineers with MATLAB home >
4: Multi-element row array indexing using integer arrays
zyBooks catalog
Integer indexing array: Reverse subsets
Construct an indexing array indexArray so that the statement reversedOrder = origOrder(indexArray); results in a row array beginning at startingindex down to element 1.
Ex: If origOrder is 2,8,9,15,3,44,23,25,7,68 and startingValue is 3, then reversedOrder is 9,8,2. Row array reversedOrder contains origOrder's element 3, element 2, and element 1.
Function 0
B Save
CReset
MATLAB Documentation
function reversedorder = Copysubset (startingIndex, origorder)
% startingindex: starting index of copied subset
indexarray =[1:1:1];% change index values
reversedorder =origorder(3:1);
end
Code to call your function (2)
CReset
origorder =[2,8,9,15,3,44,23,25,7,68];
Copysubset (3,or igorder)
 2y Section 3.4- CMPSC 200: Prog x C. Construct an indexing

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!