MATLAB: Integral solving syntax for new MATLAB users

integralsyntax

how can I write the syntax for this integral in MATLAB ?
I am solving a system of coupled non linear equations and I am new to MATLAB

Best Answer

x1 = @(tau) tau.^2; % define x1(tau)
gamma = 1;
t0 = 0;
t = 2;
int_term = @(tau) exp(-gamma*(t-tau)).*x1(tau);
g = integral(int_term, t0, t);
Related Question