I need a function or boucle

8 visualizaciones (últimos 30 días)
Rezki Amara
Rezki Amara el 5 de Abr. de 2022
Comentada: Les Beckham el 5 de Abr. de 2022
Hello everyone,
I need a function or boucle to do
ex:
X1 X2 X3 X4 X5 X6 X7 X8 X9 X10
X2 X3 X4 X5 X6 X7 X8 X9 X10 X1
X1 X3 X4 X5 X6 X7 X8 X9 X10 X2
X1 X2 X4 X5 X6 X7 X8 X9 X10 X3
....
.
.
thnks
  3 comentarios
Image Analyst
Image Analyst el 5 de Abr. de 2022
I had to look it up, so I'm assuming others (not in the knitting world) don't know what boucle is, so here's the definition:
Definition of bouclé
1 : an uneven yarn of three plies one of which forms loops at intervals
2 : a fabric of bouclé yarn
Les Beckham
Les Beckham el 5 de Abr. de 2022
It can also mean "loop"

Iniciar sesión para comentar.

Respuesta aceptada

Voss
Voss el 5 de Abr. de 2022
X = 1:10;
M = [];
idx = 1:numel(X);
for ii = idx([end 1:end-1])
M = [M; X(idx ~= ii) X(ii)];
end
disp(M);
1 2 3 4 5 6 7 8 9 10 2 3 4 5 6 7 8 9 10 1 1 3 4 5 6 7 8 9 10 2 1 2 4 5 6 7 8 9 10 3 1 2 3 5 6 7 8 9 10 4 1 2 3 4 6 7 8 9 10 5 1 2 3 4 5 7 8 9 10 6 1 2 3 4 5 6 8 9 10 7 1 2 3 4 5 6 7 9 10 8 1 2 3 4 5 6 7 8 10 9

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by