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

Óscar

E-mail

Personal Profile:
Professional Interests:

 

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:

http://en.wikipedia.org/wiki/Composition_(number_theory)

http://en.wikipedia.org/wiki/Partition_(number_theory)

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.:
WStruct=orderfields(THEWORKSPACE);

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);
WStruct2=cell2struct(c,WSVARS,1);

Contact us