Which is the simplest way to create neighbourhood pairs?

Respuestas (2)

Radha Krishna Maddukuri
Radha Krishna Maddukuri el 24 de Abr. de 2015
Editada: Radha Krishna Maddukuri el 24 de Abr. de 2015
I hope this helps.
B = zeros(numel(A)-1,2);
for i =1:1:(numel(A)-1)
B(i,:) = [A(i) A(i+1)];
end
Andrei Bobrov
Andrei Bobrov el 24 de Abr. de 2015
Editada: Andrei Bobrov el 24 de Abr. de 2015
hankel(a(1:end-1),a(end-1:end))
or
[a(1:end-1)', a(1:end-1)'+1]
or
a1 = a(1:end-1)
bsxfun(@plus,a1(:),[0 1])

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 21 de Abr. de 2015

Editada:

el 24 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by