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: Reading a text file into a arrays
Replies: 11   Last Post: Aug 20, 2013 8:32 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,260
Registered: 6/7/07
Re: Reading a text file into a arrays
Posted: Aug 17, 2013 9:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 8/17/2013 4:12 AM, Deva Infant Lino wrote:
>
> I have a text file that contains the following
>
> 5.23232 -0.00034
> 4.6632 -0.00041
> 7.2332 -0.00092
> 3.4598 -0.00023
>
>
> I want to read it a A = first column values
>
> B= second column values
>
> Both A and B should be in the array form so i can do further
> calculations and i need to plot those data.


Use

textread()

then.

But, don't need two variables; just use

plot(A(:,1),A(:,2))

for example.

--




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.