Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For matlab please help! Function Name: anagram Inputs: ( char ) String representing the anagram ( char ) Name of text file to write to

For matlab please help!

Function Name: anagram

Inputs:

(char) String representing the anagram

(char) Name of text file to write to

Outputs:

none

File Outputs:

1. A text file containing all the permutations of the anagram

Banned Functions:

 perms(), permute(), ipermute(), nchoosek(), combnk() 

Background:

You guys know what do. You are professional MATLAB now, you got this!

Function Description:

Given a string, recursively determine all the unique ways to rearrange the letters. (i.e all the unique permutations). For example, if the string was 'abc', the list of permutations would be {'abc','acb','bac','bca','cab','cba'}.

Write each permutation as a separate line in a text file, in alphabetical order. Case should be ignored and all letters should be lowercase in the output text file. Non-letter characters may occur in the string and should not be included. Characters may be repeated multiple times. There should be no newline character at the end of your file.

Notes:

Do not attempt to run this function with char vecs longer than about 10. If you do, you may be sitting around waiting a while.

The fourth test case will likely take a while, but all grading test cases will be shorter.

Hints:

The unique() function will be useful.

You may need a wrapper function.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Round each of the following to four-figure accuracy. 9.6455

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago