Untitled
Guest 154 12th Oct, 2024
x = [0, 10, 5, 0];
y = [0, 1, 7, 0];
figure;
plot(x, y, '-o', 'LineWidth', 2);
title('Trójkąt o wierzchołkach (0,0), (10,1), (5,7)');
xlabel('Oś X');
ylabel('Oś Y');
grid on;
axis equal;
xlim([-1, 11]); % Zakres osi X
ylim([-1, 8]); % Zakres osi Y
==========================
x = linspace(0, 2*pi, 500);
f_x = cos(x);
g_x = cos(x).^2;
h_x = cos(x).^3;
figure;
hold on;
plot(x, f_x, 'r--', 'LineWidth', 2, 'DisplayName', 'f(x) = cos(x)');
plot(x, g_x, 'b-', 'LineWidth', 2, 'DisplayName', 'g(x) = cos^2(x)');
plot(x, h_x, 'g-.', 'LineWidth', 2, 'DisplayName', 'h(x) = cos^3(x)');
xlabel('x');
ylabel('y');
legend('show', 'Location', 'best');
grid on;
title('Wykres funkcji f(x), g(x), h(x)');
hold off;
To share this paste please copy this url and send to your friends
RAW Paste Data