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: Extract numbers from table containing text and numbers
Replies: 29   Last Post: Feb 7, 2013 5:59 PM

Advanced Search

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

Posts: 8,181
Registered: 6/7/07
Re: Extract numbers from table containing text and numbers
Posted: Feb 3, 2013 10:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/2/2013 2:02 PM, Stan wrote:
> Okay so I re-tried with a direct copy-paste. It did not work. The
> leading space, as you mentioned, does not affect it.
>
> I'm on Win 32. Unfortunately, I do not have access to R2012b.
>
> Is there a way to read in that string using some other function (fscanf,
> etc.)?

>> type stan.txt

Q (upper-edge --0.1250E-03 AmP )= 0.98880E-02+- 0.28300E-03
units/alpha/round
Q (upper-edge --0.2500E-03 AmP )= 0.19648E-01+- 0.39412E-03
units/alpha/round
Q (upper-edge --0.3750E-03 AmP )= 0.18384E-01+- 0.38318E-03
units/alpha/round
Q (upper-edge --0.5000E-03 AmP )= 0.17536E-01+- 0.37040E-03
units/alpha/round
Q (upper-edge --0.6250E-03 AmP )= 0.16064E-01+- 0.36000E-03
units/alpha/round
Q (upper-edge --0.7500E-03 AmP )= 0.15888E-01+- 0.35954E-03
units/alpha/round

>> [a,b,c]=textread('stan.txt','Q (upper-edge -%f AmP )= %f+- %f %*s')
a =
1.0e-03 *
-0.1250
-0.2500
-0.3750
-0.5000
-0.6250
-0.7500
b =
0.0099
0.0196
0.0184
0.0175
0.0161
0.0159
c =
1.0e-03 *
0.2830
0.3941
0.3832
0.3704
0.3600
0.3595
>>

TEXTREAD(), while having been relegated to "red-haired stepchld" status,
is still highly valuable...

--



Date Subject Author
1/31/13
Read Extract numbers from table containing text and numbers
Stan
1/31/13
Read Re: Extract numbers from table containing text and numbers
Stan
2/1/13
Read Re: Extract numbers from table containing text and numbers
Stan
2/1/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/1/13
Read Re: Extract numbers from table containing text and numbers
Stan
2/2/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/2/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/2/13
Read Re: Extract numbers from table containing text and numbers
Stan
2/2/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/2/13
Read Re: Extract numbers from table containing text and numbers
Stan
2/2/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/3/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/3/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/3/13
Read Re: Extract numbers from table containing text and numbers
Bruno Luong
2/3/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/3/13
Read Re: Extract numbers from table containing text and numbers
Bruno Luong
2/3/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/3/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/4/13
Read Re: Extract numbers from table containing text and numbers
Bruno Luong
2/4/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/4/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/5/13
Read Re: Extract numbers from table containing text and numbers
Bruno Luong
2/5/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/5/13
Read Re: Extract numbers from table containing text and numbers
Bruno Luong
2/5/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/5/13
Read Re: Extract numbers from table containing text and numbers
dpb
2/3/13
Read Re: Extract numbers from table containing text and numbers
Stan
2/3/13
Read Re: Extract numbers from table containing text and numbers
Bruno Luong
2/7/13
Read Re: Extract numbers from table containing text and numbers
Stan

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

[Privacy Policy] [Terms of Use]

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