store vectors in matrix over for loop
Mostra commenti meno recenti
Hi,
How to store pairvec(in below code) variable in matrix overnested(ix1,ix2) loops. Pls help me in doing this.
Thanks, SIta
clc;
clear;
x1s=rand(3,1)
x2s=rand(3,1)
for ix1=1:3
for ix2=1:3
pairvec(:,:,ix1*ix2)= horzcat(x1s(ix1),x2s(ix2))
temp=pairvec
end
% finalvec=pairvec(ix1*ix2,:)
end
Risposta accettata
Più risposte (1)
David Sanchez
il 10 Mag 2013
0 voti
Could you be more precise? Did you realize your pairvec is a 3D array, overnested(ix1,ix2) looks like a 2D array. Did you skip the semicolons (';') at the end of each line on purpose?
1 Commento
sita
il 10 Mag 2013
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!