×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Matlab 'for loop' help!!

Matlab 'for loop' help!!

Matlab 'for loop' help!!

(OP)
I need a for loop to pick numbers to be saved in an existing matrix, the matrix is the same size as the amount of data (non square). The sequence in which the numbers have to be picked is as shown in the image below. It starts at the dot and follow the arrows to see the order in which numbers should be store.

Maybe it is a simple question but I am stuck, so please help melove

RE: Matlab 'for loop' help!!

I doubt you'd use a for loop for that

I'd do the first three by saying

newmatrix(3)=weird_dot_value
newmatrix(6)=oldmatrix(3)
newmatrix(9)=oldmatrix(6)

and so on

//ok there is some structrue there you could put in a loop

for ii=1:12
%stuff goes in here with modulo arithmetic or lots of test cases
end

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close