how to generate code ?

1 vue (au cours des 30 derniers jours)
ankanna
ankanna le 21 Mar 2021
Commenté : Walter Roberson le 25 Avr 2021
node = 3;
Link = (node-1)*node/2
NN = toeplitz(node+1:-1:2);
mask = logical(fliplr(diag(ones(1,node-1),-1)));
NN(mask) = 1;
for n = 0:2^Link -1
out(:,:,n+1)= bitget(n, NN);
end
output
val(:,:,1) =
0 0 0
0 0 0
0 0 0
val(:,:,2) =
0 0 0
0 0 1
0 1 0
val(:,:,3) =
0 0 1
0 0 0
1 0 0
val(:,:,4) =
0 0 1
0 0 1
1 1 0
val(:,:,5) =
0 1 0
1 0 0
0 0 0
val(:,:,6) =
0 1 0
1 0 1
0 1 0
val(:,:,7) =
0 1 1
1 0 0
1 0 0
val(:,:,8) =
0 1 1
1 0 1
1 1 0
Link = (node-1)*node/2
please help to generate upto n nodes

Réponses (1)

Walter Roberson
Walter Roberson le 21 Mar 2021
  9 commentaires
ankanna
ankanna le 25 Avr 2021
allpaths is not taking directly matlab
Walter Roberson
Walter Roberson le 25 Avr 2021
As I posted "This requires R2021a."
You are using R2016a.
You should consider updating your MATLAB.

Connectez-vous pour commenter.

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by