how to graph a sine in matlab

main.m
% Define the range for x values
x = 0:0.1:2*pi;

% Calculate y values using the sine function
y = sin(x);

% Plot the sine wave
plot(x, y)
xlabel('x');
ylabel('sin(x)');
title('Sine Function');
grid on;
203 chars
13 lines

related categories

gistlibby LogSnag