How can I input the two functions from this task in matlab ?
A voltage peak in a circuit is caused by a current through a resistor.

The energy E which is dissipated by the resistor is:
Calculate E if

This is my final solution:
function E = calculateE(i0,R,t0)
syms t;
f = i0*exp(-t/t0) * sin(2*t/t0);
E = int(R*f*f,0,inf);
end
Question: how can I input the above functions in matlab to calculate the result?
You can write a MATLAB function like