81.4k views
5 votes
. Write a function wordscramble that will receive a word in a string as an input argument. It will then randomly scramble the letters and return the result. Here is an example of calling the function: >> wordscramble('fantastic') ans = safntcait

1 Answer

3 votes

Answer: You can use the function randperm() to generate a random permutation of the indexes. so then you would use the random permutation to reorder the string array

Step-by-step explanation:

User Adi Inbar
by
5.5k points