Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 Derek Goring Posts: 3,922 Registered: 12/7/04
Re: convert string to scalar, Is it possible?
Posted: Feb 6, 2013 3:31 AM

On Wednesday, February 6, 2013 9:18:08 PM UTC+13, grega wrote:
> 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

DON'T DO THIS!!

You will end up in an awful muddle and no one here will have any sympathy for you.
Instead, learn to use structures, whence you would have:
s.a=1
s.b=4
s.c=6
Believe me, learning this will improve the quality of your life.

Date Subject Author
2/6/13 grega
2/6/13 Jos
2/6/13 grega
2/6/13 Derek Goring
2/6/13 grega
2/6/13 Derek Goring