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 Commento

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.

Accedi per commentare.

Risposte (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 Commento

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.

Accedi per commentare.

Categorie

Scopri di più su Elementary Math in Centro assistenza e File Exchange

Richiesto:

il 15 Mag 2016

Commentato:

Rik
il 17 Giu 2020

Community Treasure Hunt

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

Start Hunting!

Translated by