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: convert a single quotation variable to a normal variable,
Replies: 2   Last Post: Jul 28, 2012 5:21 PM

Advanced Search

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

Posts: 91
Registered: 8/31/11
Re: convert a single quotation variable to a normal variable,
Posted: Jul 28, 2012 5:21 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Barry Williams" <barry.r.williamsnospam@saic.com> wrote in message <jur59k$li5$1@newscl01ah.mathworks.com>...
> "vj " <vijay.easwari@gmail.com> wrote in message <jur02o$50m$1@newscl01ah.mathworks.com>...
> > Hi,
> >
> > I have a variable '56', I would like to convert it to 56, can anyone help me on this?
> > Thank you.

> You don't have a lot of additional explanation here, but it appears that you have an integer, single, or double precision number stored as a string variable. What you need to do to convert it depends upon the type of variable and the final numeric data type you need. Some possibilities:
> newVar=str2num(cell2mat(cellVar)); % If the number is stored as in a cell as a string
> newVar=str2num(strVar); % If stored as a string array
> Barry

thank you Barry..

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

[Privacy Policy] [Terms of Use]

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