フィルターのクリア

Checking if an index has been used

1 回表示 (過去 30 日間)
Janell Lopez
Janell Lopez 2016 年 3 月 13 日
回答済み: John D'Errico 2016 年 3 月 13 日
I am to create a function called "anagram" that will receive an input string, shuffle the letters, and return an output string of the randomly arranged characters. Specifically, right now, I have to use a for loop that generates a random index of the input string, with an if statement that will check if the index has been used already to avoid repetition (I asked a question about this earlier but now I'm more clear on the requirements).
I'm just confused as to how to iterate through the output vector that's being created, to see if the index has been used already. I'm thinking an if statement, but what should my condition be, to run through the index and see if it's in there?

回答 (1 件)

John D'Errico
John D'Errico 2016 年 3 月 13 日
help ismember

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by