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 Kommentar

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.

Melden Sie sich an, um zu kommentieren.

Antworten (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 Kommentar

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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Elementary Math finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 15 Mai 2016

Kommentiert:

Rik
am 17 Jun. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by