This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/programming/exercises/plotsinewave.m

14 lines
319 B
Matlab

function plotsinewave(time, sine)
% plot precomputed sinewave
% time: vector with timepoints
% sine: corresponding vector with sinewave
if time(end)-time(1) <= 1.0
plot(1000.0*time, sine);
xlabel('Time [ms]');
else
plot(time, sine);
xlabel('Time [s]');
end
ylim([1.2*min(sine) 1.2*max(sine)]);
ylabel('Sinewave');