Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Save FOR loop data into a vector
Replies: 1   Last Post: Feb 13, 2014 10:31 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Agent Cooper

Posts: 1
Registered: 2/13/14
Save FOR loop data into a vector
Posted: Feb 13, 2014 4:13 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.