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: Moving characters in a string
Replies: 2   Last Post: Feb 24, 2013 8:32 AM

Advanced Search

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

Posts: 8,819
Registered: 7/26/08
Re: Moving characters in a string
Posted: Feb 24, 2013 7:03 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Joe" wrote in message <kgcq3f$j9i$1@newscl01ah.mathworks.com>...
> Hello, I'm new to Matlab and having some trouble with some stuff.
>
> How would I moving characters in a string from one position to another.
>
> For example: original string='old123'
> newstring='123old'


String is an array. Just manipulate it as with an array:

newstring = oldstring([4:6 1:3])

Bruno



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.