Here is my code
function [] = plotFile(heartRate,titleName,beats,dt)
%%Function plotFile
%This function is to be used with FILENAME and will display inputs
%vs. the outputs in the first figure. In the second figure, an ECG of the
%first instance of the input file will be displayed.
titleName = 'Data';
heartRate = [60;69;55;50;42];
beats = [100;80;60;10;12];
dt = [00;70;65;12;17];
%%Plot inputs vs. outputs
figure(1)
hold on
plot(dt,heartRate,'r*','MarkerFaceColor','r')
plot(beats,heartRate,'b*','MarkerFaceColor','b')
xlabel('Time (s)')
ylabel('Beats')
legend('Time vs. Heart rate','Beats vs. Heart rate')
ylim([0 inf])
xlim([0 inf])
title(titleName)
hold off
%%Plot ECG Signal
heartRate = heartRate(1,1);
Fs = heartRate/60;
x = ecg(2700);
y = repmat(x,[1 30]);
sigData = y(1:16000)';
t = linspace(0, 15999, 16000)/Fs;
figure(2)
plot(t,sigData)
ylabel('Voltage (mV)')
xlabel('Seconds')
legend('ECG Signal')
axis ([0 16000 -2 2])
title(titleName)
end
%%Attempt at scope
% TS_ECG = dsp.TimeScope('SampleRate', Fs,...
% 'TimeSpanSource', 'Auto',...
% 'ShowGrid', true,...
% 'TimeUnits','Seconds',...
% 'Title',titleName);
% TS_ECG(sigData);
% TS_ECG.YLimits = [-2, 2];