One parameter plotyy()
x = 1:10;
y = rand(1,10);
plotyy(x, x, x, y)
A more flexible option is to superimpose two (or more) axes and determine which data you want to display on each of them.
% Sample data
x = 1:10;
y = rand(1,10);
% Create axes & store handles
h.myfig = figure;
h.ax1 = axes('Parent', h.myfig, 'Box', 'off');
h.ax2 = axes('Parent', h.myfig, 'Position', h.ax1.Position, 'Color', 'none', 'YAxisLocation', 'Right');
% Preserve axes formatting
hold(h.ax1, 'on');
hold(h.ax2, 'on');
% Plot data
plot(h.ax1, x, x);
plot(h.ax2, x, y);
Box . , , .
Position , . , , R2014b, , h.ax1.Position get(h.ax1, 'Position').
Color YAxisLocation .
hold . , reset , .
, !