954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

looping problem

Hey guys, in matlab when u do a loop(something like this):

for i=1:3
a= 2*i
end

You get a=2
a=6
a=9
any idea how do i assign the 3 answers(a) names so that i can calculate the product of all 3 answers?

jubleebow
Newbie Poster
9 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 
Hey guys, in matlab when u do a loop(something like this): for i=1:3 a= 2*i end You get a=2 a=6 a=9 any idea how do i assign the 3 answers(a) names so that i can calculate the product of all 3 answers?

Maybe:

a = 0
for i=1:3
 a= a * (2*i)
 end
WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You