Matlab Function to Compute Matrix Operations

1 回表示 (過去 30 日間)
Adin
Adin 2014 年 3 月 31 日
回答済み: dpb 2014 年 4 月 1 日
So I want to make a function to compute the result of the following equation:
My matlab .m function file starts off with:
function dNdt = compute(t, N, E, A)
But I am having trouble figuring out how to add up matrices...and particular rows/columns at that. I know I have to use the symsum command but mine is a little different from all the examples I've seen since I'm dealing with matrices. Any idea on how to go about this?

採用された回答

dpb
dpb 2014 年 4 月 1 日
In Matlab the RHS is just
N.*(E+a*N)
where
size(N)=[3,1]
size(a)=[3,3]
That's taking the shortcut of not expanding the diagonal matrix the multiplication of which reduces to the element by element of the diagonal elements.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by