Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Mar 15, 2007
Messages
2
Location
NL
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



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top