Effacer les filtres
Effacer les filtres

Extract row each iteration

1 vue (au cours des 30 derniers jours)
Miroslav Mitev
Miroslav Mitev le 22 Fév 2018
Commenté : Miroslav Mitev le 22 Fév 2018
I would like to extract a 1-row vector "K" that changes each iteration and create a matrix "C" with rows equal to the vector. I have a while loop that determines the values of "K" and just want to rerun the program 1000 times and save all "K" in the Matrix "C" as rows. This is what I am doing but looks like something is not as it is supposed be:
for ii=1:1000
while ....
K=...
end
C(ii,:)=K
end
  5 commentaires
Raphael Klapczynski
Raphael Klapczynski le 22 Fév 2018
Modifié(e) : Raphael Klapczynski le 22 Fév 2018
It looks like a problem caused by K vector. The for loop works without any problems for me. Or you manipulate ii inside the while-loop.
for ii=1:4
K = rand([1 3]);
C(ii,:)=K
end
Miroslav Mitev
Miroslav Mitev le 22 Fév 2018
Thank you for your comments. I did solve the issue.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by