how to write algorithm for code?

3 views (last 30 days)
ankanna
ankanna on 22 Mar 2021
Commented: Walter Roberson on 11 Apr 2021
node = 3;
Link = (node-1)*node/2
NN = toeplitz(Link+1:-1:2);
mask = logical(fliplr(diag(ones(1,Link-1),-1)));
NN(mask) = 1;
for c = 0:2^Link-1
out = bitget(c, NN)
end
format long g
lamda = 0.7;
bits = dec2bin(0:2^node-1)-'0';
nl = sum(bits,2);
nu = node-nl;
P = lamda.^nl .* (1-lamda).^nu;
P(1:8)
[minP, minidx] = min(P)
bits(minidx,:)
[maxP, maxidx] = max(P)
bits(maxidx,:)
please help me to write algorithm
  5 Comments
Walter Roberson
Walter Roberson on 11 Apr 2021
Reliability does not fit with that code.

Sign in to comment.

Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Products


Release

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by