Is there a way to come up with all the combination between 0 and 1 that sum up to equal 1?
- All combination between 0 and 1. y4 = [Ny4 Hy4 Ay4 Cy4] , if sum(y4) = 1
- Put Them into sum(((K-1).*y4)./(1+(K-1)*v)) = 0 to solve for v.
- Then x5 = y4./(1+(K-1).*v), if sum(x5) = 1
- finally y6 = K.*x5, if sum(y6) = 1
When I used nchoosek([0:1/10000:1],4) I get error.
Error using zeros
Maximum variable size allowed by the program is exceeded.
Error in nchoosek>combs (line 164)
P = zeros(total, k, 'like', v);
Error in nchoosek (line 123)
c = combs(v,k);
I solved this using excel solver, that is how I got the values.
Ny4 = 0.108536069;
Hy4 = 0.772457477;
Ay4 = 0.117147745;
Cy4 = 0.001858709;
y4 = [Ny4 Hy4 Ay4 Cy4];
NK = 4.8;
HK = 70;
AK = .051;
CK = .32;
K = [NK HK AK CK];
t = sum(((K-1).*y4)./(1+(K-1)*v));
x5 = y4./(1+(K-1).*v)
y6 = K.*x5
testy6 = sum(y6)