Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Sebastian

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

Hi,

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:

instruction(X)

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]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.