help on randfixedsum error?

1 回表示 (過去 30 日間)
reshdev
reshdev 2014 年 9 月 12 日
回答済み: Roger Stafford 2014 年 9 月 12 日
hello,
i am trying to use randfixed sum(link below) for n=1 and m=4 and s=5. limit of random for each element should be between 0 t0 5.
so, i am entering randfixedsum(n,m,s,a,b)= randfixedsum(1,4,5,0,5) to get 1*4 matrix.
but it is displaying ' Undefined function or method 'randfixedsum' for input arguments of type 'double'.'
what this thing is?.how can i overcome it?

採用された回答

Roger Stafford
Roger Stafford 2014 年 9 月 12 日
The arguments you use for 'randfixedsum' are rather strange! It is the columns whose sum must be 5 and your columns have only one element, so that element must be 5. There would be nothing randome about it. You could just as well have written:
repmat(5,1,4)
or
5*ones(1,4)
To get a row vector whose sum is 5, take the transpose of a 4 by 1 vector:
randfixedsum(4,1,5,0,5).'
As to the error message, it looks as though you haven't downloaded that file exchange function properly. Try again. Click on the button that says, "Download Submission".

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by