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 个评论

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.

请先登录,再进行评论。

回答(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 个评论

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.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息

评论:

Rik
2020-6-17

Community Treasure Hunt

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

Start Hunting!

Translated by