Thread Subject: str2double

Subject: str2double

From: recep mansiz

Date: 12 Aug, 2009 12:27:03

Message: 1 of 6

Hi all!!

I have a variable x with type cell that has a value '0.009867'.

when I use str2double (x) command I get the result "0.0100" but I need
 "0.009867 " value instead. how can I achieve it??

thanks in advance...

Subject: str2double

From: Vadim Teverovsky

Date: 12 Aug, 2009 12:40:44

Message: 2 of 6

You are getting the right value, but your display is only showing you the
first four digits.
use
format long g
for example, if you want to see more digits. However, realize that the
number is correct.


"recep mansiz" <aalmoraa@hotmail.com> wrote in message
news:h5ucen$jpq$1@fred.mathworks.com...
> Hi all!!
>
> I have a variable x with type cell that has a value '0.009867'.
>
> when I use str2double (x) command I get the result "0.0100" but I need
> "0.009867 " value instead. how can I achieve it??
>
> thanks in advance...

Subject: str2double

From: us

Date: 12 Aug, 2009 12:42:19

Message: 3 of 6

"recep mansiz" <aalmoraa@hotmail.com> wrote in message <h5ucen$jpq$1@fred.mathworks.com>...
> Hi all!!
>
> I have a variable x with type cell that has a value '0.009867'.
>
> when I use str2double (x) command I get the result "0.0100" but I need
> "0.009867 " value instead. how can I achieve it??
>
> thanks in advance...

a hint:
- on the assumption that you use the stock function STR2DOUBLE

     help format;
% maybe you use...
% format bank;

us

Subject: str2double

From: qooroo

Date: 12 Aug, 2009 12:43:03

Message: 4 of 6

"recep mansiz" <aalmoraa@hotmail.com> wrote in message <h5ucen$jpq$1@fred.mathworks.com>...
> Hi all!!
>
> I have a variable x with type cell that has a value '0.009867'.
>
> when I use str2double (x) command I get the result "0.0100" but I need
> "0.009867 " value instead. how can I achieve it??
>
> thanks in advance...

str2double(char(x))

-qooroo

Subject: str2double

From: qooroo

Date: 12 Aug, 2009 12:44:05

Message: 5 of 6

or: doc cell2mat

-qooroo

Subject: str2double

From: qooroo

Date: 12 Aug, 2009 12:50:19

Message: 6 of 6

or I may have completely misread your post.

-qooroo

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
reference us 12 Aug, 2009 08:44:15
str2double recep mansiz 12 Aug, 2009 08:29:05
rssFeed for this Thread

Contact us at files@mathworks.com