Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Save FOR loop data into a vector
Posted:
Feb 13, 2014 4:13 AM


Hello everybody,
I have a problem when I try to place the data that I get from a FOR loop into a vector. Here is my example:
X = [ 5 1 2 9 100 3 ]
for i = X(1:1:end) if find(0<i & i<10) == 1 Y = i else Y = NaN end end
I get the results generated after every iteration. I would like them placed into a vector. Could anyone give me a hint?



