MATLAB: Can’t plot output of inverse laplace function

inverse laplacelaplaceplotplotting

i am trying to plot the function that i get when applying inverse laplace, but i get an error that says:
Error using plot
Data must be numeric, datetime, duration or an array convertible to double.
Error in eecDP (line 34)
plot(t, i16)
here is my code:
for L=(1:1:10)
syms s t
LEs=[4+L*s+2/s -2/s 0;
-2/s 4+s+2/s 1/s];
I=rref(LEs);
I1=I(1,3);
%I2=I(2,3)
i1=ilaplace(I1)
eqni1 = i1==0.1;
L
I1
t = solve(eqni1, t)
end
disp('We will be choosing the value of L=6H, this will give us a value for t=2.85s which is less than 3s')
I6=rref([4+6*s+2/s -2/s 0; -2/s 4+s+2/s 1/s]);
I16=I6(1,3);
i16=ilaplace(I16)
t=0:0.1:5;
plot(t, i16)

Best Answer

Try this:

i16= vpa(ilaplace(I16))
fplot(i16, [0 5])

Substitute those 2 lines for the last 3 lines of the code you posted.

Related Question