Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


How to PLOT a FILE of data points

Matlab is actually quite useful even for things as simple as plotting a
file of data points.  First you'll need a file with all the proper values.
Let's say you have a file with all your data, arranged like this:

        x1 y1
        x2 y2
        x3 y3
        .. ..
        xn yn

Let's additionally say that the name of the file is "test.dat".  To load
the data into matlab you would type the following at the matlab prompt:

        load test.dat

Then "test" becomes a matrix where the first column is X and the second
column is Y.  To plot this, you can type:

        plot( test(:,1), test(:,2) )

Where "test(:,1)" means "the entire first column of matrix test".

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.