gistlib
main.m% Define x values x = linspace(-2*pi, 2*pi, 1000); % Calculate y values for half-wave sine wave y = sin(x); y(x < 0) = 0; % Plot the half-wave sine wave plot(x,y) title('Half-Wave Sine Wave') xlabel('x') ylabel('y') 218 chars13 lines
% Define x values x = linspace(-2*pi, 2*pi, 1000); % Calculate y values for half-wave sine wave y = sin(x); y(x < 0) = 0; % Plot the half-wave sine wave plot(x,y) title('Half-Wave Sine Wave') xlabel('x') ylabel('y')
gistlibby LogSnag