# Matlab, plot

1. May 8, 2012

### Elliptic

I have a set of measured data. I need to plot this in matlab and show two graphs in one plot.
Data for first graph is : [0.35,0],[0.4,130],[0.45,400],[0.5,0.11],[0.55,34] and so on.
Second graph is a function.

So, how to plot sequence of data in matlab? Which command should I use?

2. May 8, 2012

### Steely Dan

Try the following:

x = [0.35 0.4 0.45 0.5 0.55] % (defines the x values in a vector)

y = [0 130 400 0.11 34] % (defines the y values in a separate vector)

plot(x,y) % (makes a plot of y plotted against x)

3. May 8, 2012

### Elliptic

how to display two plots plot1 and plot 2 in one graph? thank you

4. May 8, 2012

### Steely Dan

You could do, for example,

plot(x1,y1,x2,y2)

By the way, the MATLAB documentation is quite thorough. Try typing "help plot" to learn more about the syntax and features of the plot function. Also, there's a ton of information on the web about using MATLAB in case you ever get stuck.

5. May 13, 2012

### chris_usyd

#4 is right

6. May 17, 2012

### chris_usyd

wait...
its' gonna be plotyy(x1,y1,x2,y2)