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: convert string to scalar, Is it possible?
Replies: 5   Last Post: Feb 6, 2013 3:57 AM

Advanced Search

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

Posts: 58
Registered: 10/29/07
Re: convert string to scalar, Is it possible?
Posted: Feb 6, 2013 3:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have number of column indeces, e.g. A = [1, 4, 6,...] and corresponding labels in strings, e.g. B = {'a' 'b' 'c' ...}, so I would like to assign indeces to corresponding strings, so that the results is:
a = 1;
b = 4;
c = 6;

Hope I provided a bit more insight for suggestions :) Tnx

> yes it is possible, but first of all, really think about why you want to do this?
> help eval
> ~ Jos

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.