plot rectified half sine in matlab

main.m
% Define the x-axis
x = linspace(0,2*pi,1000);

% Generate half sine wave
y = abs(sin(x));

% Plot the rectified half sine wave
plot(x,y);
xlabel('Time');
ylabel('Amplitude');
title('Rectified Half Sine Wave');
211 chars
12 lines

related categories

gistlibby LogSnag