So I just started an ECE480 class, and this is the first time I've ever used Matlab... and I'm having a problem figuring this out.
I have to find an integral of x=(4*t.^2).*(.5.^t) from 0 to t1. I need to find t1.
So I understand how to integrate using matlab. One part of this lab was to integrate from 0 to infinity of this function.
t=[0:.01:100]';
x=(4*t.^2).*(.5.^t);
x=fun(t);
area=quad(@fun,0,100)
Knowing that I dont need to integrate to inf, I just used 100 as my upper limit.
Now with the problem I'm having..... integral of x,0,t1 is =16.16, so I must solve for to so that this is true.
It was recommended to use an if or a while loop to complete this, but I keep getting errors using them.
I know the answer because my trusty TI-89 can solve it in one line:
solve(integral(x,t,0,t1)=16.16) Is there a way I can do that with matlab or not?
Thanks for any help
Michael
I have to find an integral of x=(4*t.^2).*(.5.^t) from 0 to t1. I need to find t1.
So I understand how to integrate using matlab. One part of this lab was to integrate from 0 to infinity of this function.
t=[0:.01:100]';
x=(4*t.^2).*(.5.^t);
x=fun(t);
area=quad(@fun,0,100)
Knowing that I dont need to integrate to inf, I just used 100 as my upper limit.
Now with the problem I'm having..... integral of x,0,t1 is =16.16, so I must solve for to so that this is true.
It was recommended to use an if or a while loop to complete this, but I keep getting errors using them.
I know the answer because my trusty TI-89 can solve it in one line:
solve(integral(x,t,0,t1)=16.16) Is there a way I can do that with matlab or not?
Thanks for any help
Michael