# MATLAB: How to write a program, and shuffles only the inner letter of the word

scrambleshuffleword

How to write a program, and shuffles only the inner letter of the word, but leave the first and last letter of the word alone? Thank you

word = 'abcdefgh'middleIndexes = randperm(length(word)-2) + 1newWord = [word(1), word(middleIndexes), word(end)]