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/plotsinec.m

15 lines
272 B
Matlab

freq = 5.0;
ampl = 2.0;
[time, sine] = sinewave(freq, ampl, 1.5);
if duration <= 1.0
plot(1000.0*time, sine);
xlabel('Time [ms]');
else
plot(time, sine);
xlabel('Time [s]');
end
ylim([-1.2*ampl 1.2*ampl]);
ylabel('Sinewave');
title(sprintf('Frequency %g Hz', freq));