Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create names with a for loop

Status
Not open for further replies.

oosterling

Mechanical
Mar 15, 2007
2
Hi,

i have a (basic) question about the "for end" loop.

I would like to make 1000 names with a value of 1 (value is not important) without having to type them all.

M1=[1]
M2=[1]
M3=[1]
...
M1000=[1]

Can i do this with a for end loop?

for i=1:1000
Mi=[1]
end

This didn't work but best represent the idea.

Any feedback would be appreciated.

Regards, Oosterling



 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor