how to generate code ?

1 visualización (últimos 30 días)
ankanna
ankanna el 21 de Mzo. de 2021
Comentada: Walter Roberson el 25 de Abr. de 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

Respuestas (1)

Walter Roberson
Walter Roberson el 21 de Mzo. de 2021
  9 comentarios
ankanna
ankanna el 25 de Abr. de 2021
allpaths is not taking directly matlab
Walter Roberson
Walter Roberson el 25 de Abr. de 2021
As I posted "This requires R2021a."
You are using R2016a.
You should consider updating your MATLAB.

Iniciar sesión para comentar.

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by