Storing Data from While loop
Afficher commentaires plus anciens
Hello, I'm trying to create a matrix with the outputs of a while loop. Attached is an image which will help visualize what I'm doing. The y-axis is Y, and the x-axis is i.

Every time the y-value is at 4 I want to evaluate a function of those indices and store in a matrix. When the function is at 5 and returns to 4 I'd like to create a new index in the matrix and evaluate the function.
heres what i have
for i = (25600:26000)
while y == 4
for n = 1:50
A(n) = log (i)
else
A (n) = A (n+1)
end
end
Thanks for your help!
1 commentaire
Stephen23
le 25 Jan 2015
Do not use i (or j) as the names of your variables, as these are the names of the inbuilt imaginary unit .
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!