how to write a function for the inbuilt function perms without using perms nor any built-in MATLAB permutation functions; nor any built-in string manipulation functions in the solution?

So basically i have to write a function to replace the inbuilt function perms without obviously using perms in the solutions or any built-in MATLAB permutation functions; nor any built-in string manipulation functions in the solution.

1 Comment

Regarding the flag by Kegan Ferreira ("An employer ran into this and asked to take it down. Could you please remove this."):
I doubt an employer has any standing to require this. What reason did they give you?
Just in case you decide to edit away your question I will post a copy of it below (making you editing away the post pointless). If you provide a valid reason for deletion I will remove your question from my post.
how to write a function for the inbuilt function perms without using perms nor any built-in MATLAB permutation functions; nor any built-in string manipulation functions in the solution?
So basically i have to write a function to replace the inbuilt function perms without obviously using perms in the solutions or any built-in MATLAB permutation functions; nor any built-in string manipulation functions in the solution.

Sign in to comment.

Answers (1)

This is pretty clearly homework, so I doubt if anyone is going to state anything other than a hint. My own hint would be to write an appropriate recursion routine that can accept a vector, then run through that vector’s elements one at a time and for each one, call itself recursively with the remaining vector of elements for further like processing. End of hint.

1 Comment

My hint would be that there's probably some pseudocode describing how to generate permutations in your textbook, and converting that pseudocode into MATLAB code probably isn't going to be that difficult.

Sign in to comment.

Categories

Asked:

on 15 May 2016

Commented:

Rik
on 17 Jun 2020

Community Treasure Hunt

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

Start Hunting!