The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to save and execute segments of code???
Replies: 2   Last Post: May 17, 2013 6:50 PM

Advanced Search

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

Posts: 4
Registered: 5/17/13
How to save and execute segments of code???
Posted: May 17, 2013 3:19 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I'm currently programming a robot in Matlab and it must do specific tasks depending the stage of the whole process it is currently in.

The thing is that, It would be wonderful to be able to save chunks of code with complex instructions for the robot to follow, index them somehow, and then call those codes from the main .m file.

For example:

instruction(1) -> Set of instructions for the first stage
instruction(2) -> Set of instructions for the second stage
... and on ...

So I can then call:


where X is the stage it is currently in

I already have all the stage instructions in a separate .m file, now I just need a smart way of calling the different segments

Thank you!!!

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.