答案 0 :(得分:0)
figure % create a figure
hold on % Keep plot when making more plots
% first section
plot([0,9],[2500 2500],'k') % plot a constant line from 0-9 where y = 2500
% second section
x = linspace(0,9); % create array from 0 to 9 in 100 points
f = @(x) 2500 + sin(x*pi/9)*2500; % create wave function, using x
plot(x+9,f(x),'k')
% third section
plot([18,24],[2500 2500],'k') % plot a constant line from 18-24, y = 2500
% Change y limits
ylim([0 5000])