gistlib
main.m% Define the function x = linspace(-5, 5, 1000); y = x.^3 - 5*x + 1; % Plotting the graph plot(x, y) xlabel('x') ylabel('y') title('Graph of y = x^3 - 5x + 1') % Calculate y(10) y_at_10 = 10^3 - 5*10 + 1; disp(['y(10) = ', num2str(y_at_10)]); 245 chars14 lines
% Define the function x = linspace(-5, 5, 1000); y = x.^3 - 5*x + 1; % Plotting the graph plot(x, y) xlabel('x') ylabel('y') title('Graph of y = x^3 - 5x + 1') % Calculate y(10) y_at_10 = 10^3 - 5*10 + 1; disp(['y(10) = ', num2str(y_at_10)]);
gistlibby LogSnag