Integral of exponential matrix
10 ビュー (過去 30 日間)
古いコメントを表示
I am looking into integrating a function of the form
where M is a square matrix. It can either be symbolic or not (t is given at the time of computation).
How should I set up the code? I am using expm to compute the exponent, but the integral gives me an error in the multiplication: Matrix dimensions must agree.
M = [1 2; 3 4];
tf = 1;
Qk=integral(@(t) expm(M.*t),0,tf);
Thank you!
0 件のコメント
回答 (1 件)
Steven Lord
2020 年 6 月 19 日
Tell MATLAB your integrand doesn't return a vector the same size as the input but should be called with a scalar and will return an array.
Qk=integral(@(t) expm(M.*t),0,tf, 'ArrayValued', true);
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!