how to split a column matrix to sub matrix with specific type?

for this I have used nested for loop. still I was not successful. As I am a biginner for matlab I really need lot of help. If anyone can help, Please do this codeing. So far I could not able to find a tutorial for this problem.

 Respuesta aceptada

Let X be your column data and let k be your value.
% Arrange three time steps as moving window
X = rand(10,1) ;
k = 3 ;
idx = bsxfun(@plus, (1 : k), (0 : numel(X) - k).')';
iwant = X(idx)
iwant = 3×8
0.9752 0.1159 0.5926 0.0492 0.0715 0.8189 0.0654 0.8151 0.1159 0.5926 0.0492 0.0715 0.8189 0.0654 0.8151 0.4476 0.5926 0.0492 0.0715 0.8189 0.0654 0.8151 0.4476 0.4254

1 comentario

Thank you very much for your respod. this code is working properlly.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Preguntada:

el 6 de Nov. de 2021

Comentada:

el 6 de Nov. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by