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 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" <> wrote in message <jur59k$li5$>...
> "vj " <> wrote in message <jur02o$50m$>...
> > 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.