Skip to content

Instantly share code, notes, and snippets.

@rezamarzban
Last active January 21, 2024 04:33
Show Gist options
  • Save rezamarzban/9f2728ff123bf1bc5414455ea3e0d6c0 to your computer and use it in GitHub Desktop.
Save rezamarzban/9f2728ff123bf1bc5414455ea3e0d6c0 to your computer and use it in GitHub Desktop.
MATLAB function integral without symbolic pkg
% Define the function to be integrated
fun = @(x) x.^2;
% Define the integration limits
lower_limit = 0;
upper_limit = 1;
% Calculate the definite integral
result = integral(fun, lower_limit, upper_limit);
disp(['Definite integral result: ', num2str(result)]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment