Rank: 494206 based on 0 downloads (last 30 days) and 0 file submitted



Personal Profile:


Watch this Author's files


Comments and Ratings by Óscar View all
Updated File Comments Rating
27 Dec 2012 Restricted Integer Composition Generates restricted and unrestricted integer compositions Author: Theophanes Raptis

In my opinion, it should just work for those cases the original paper says. Furthermore, we should not forget compositions and partitions are usually defined for strictly positive integer numbers:



If you personally prefer any other definition (including zeroes, for example) they can be obtained from the one given by this function. See my first post.

Anyway, what Steffen is trying to compute are "weak compositions" and the goal of this function is to compute "compositions". It would be interesting to have a general implementation for "weak compositions" allowing also independent upper and lower bounds for each term.

It is true that this function should return all the compositions/partitions in a cell array (or array when all of them have the same length). Also, it should check the input arguments to avoid prohibited values.

An additional question: what happens if argument "a" takes negative values? Personally, I think it is just as weird as setting a=0.

14 Aug 2012 Save Workspace to Struct This function allows to save all the variables from the current workspace into a struct array Author: Andres

Thanks for this function. It would be nice if structure fields where sorted in somehow, e.g.:

BTW, a shorter (but slower) version of the same function would be:
WSVARS = evalin('caller', 'who');
c=cellfun(@(x) evalin('caller',x),WSVARS,'UniformOutput',false);

Contact us