Solving multiple integrals that include exp
显示 更早的评论
I can't figure out what I'm doing wrong, I keep getting an error message: Error using .* Matrix dimensions must agree.
for e = exp(k.*w.*t);
Here's the code. I just need help debugging.
T = 9; T1 = 0.25; w = 2*pi/T;
e = exp(k.*w.*t);
fun1 = @(t) (1+4*t)*e;
fun2 = @(t) (1-4.*t).*e;
k = 1;
C = (1/9).*(integral(fun1,-T1,0) + integral(fun2,0,T1))
Eventually I will use a for loop to calculate C for different k values.
1 个评论
Walter Roberson
2012-11-13
in fun2 you carefully used .* but you forgot to do that in fun1.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Execution Speed 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!