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.

 Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by