
x1 = 0:0.1:40;
y1 = 4.*cos(x1)./(x1+2);
x2 = 1:0.2:20;
y2 = x2.^2./x2.^3;

figure();

plot(x1,y1,'Color','r')         % plot the data
%title('Velocity Profile');
xlabel('Time (sec)');
ylabel('Velocity (mm/sec)');

ax1 = gca;                      % current axes
ax1_pos = get(ax1,'Position');  % get position of axis 1

ax2 = axes('Position',ax1_pos,... % setup the second XY axis
    'XAxisLocation','top',...
    'YAxisLocation','right',...
    'Color','none');
xlabel('Position (mm)');
ylabel('Velocity (mm/sec)');
axis([0 100 0 100]);

%line(x2,y2,'Parent',ax2,'Color','k')

