%% SL62
%% anonymous function
clear; close all; clc;
t_min = 0; t_max = 1;
f = 50;
I_hndl = @(t) 10*cos(2*pi*f*t) + 5*cos(4*pi*f*t);
Q = integral(I_hndl, t_min, t_max)

%% handle function
clear; close all; clc;
t = 0:0.001:1;
I = current(t);
plot(t, I)
I_hndl = @current;
Q = integral(I_hndl, t(1), t(end))

function I = current(t)
f = 50;
I = 10*cos(2*pi*f*t) + 5*cos(4*pi*f*t);
end

