Question: shuffletext Write a function shuffletext ( pairs, s ) that swaps characters of s as specified by the indices present in the pairs variable. pairs

shuffletext
Write a function shuffletext( pairs, s) that swaps characters of s as specified by the indices present in the pairs variable. pairs is a 2-column matrix, where on each row, you are given the positions of the two characters you need to swap. If s is not given, use s='O0O0O0OO000OO0OO0O00OOOOO0OO00O0O0OO0OO000000OO0OOOOO00O0O00000O'
>> disp( shuffletext([12], 'orange'))
roange
>> disp( shuffletext([12; 21], 'orange'))
orange
>> disp( shuffletext([42; 34], 'bare'))
bear
>> pairs =[14; 46; 56]
pairs =
14
46
56
>> disp( shuffletext( pairs, 'looped'))
poodle
 shuffletext Write a function shuffletext( pairs, s) that swaps characters of

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!