フィルターのクリア

I want to find vector of determinants

3 ビュー (過去 30 日間)
Jonghun
Jonghun 2013 年 7 月 28 日
a= 1 x 4 vector
b= 1 x 4 vector
c= 1 x 4 vector
d= 1 x 4 vector
-my code-
detvector=det([a b c d]);
-I want to get detvector=[det([a(1) b(1); c(1) d(1)]),det([a(2) b(2); c(2) d(2)]),det([a(3) b(3) ;c(3) d(3)]),det([a(4) b(4); c(4) d(4)])]. But my code doesn't works. How can I solve it?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 7 月 28 日
Your code is correct, you can use arrayfun function
out=arrayfun(@(x) det([a(x) b(x);c(x) d(x)]),1:numel(a))

その他の回答 (1 件)

Matt J
Matt J 2013 年 7 月 28 日
編集済み: Matt J 2013 年 7 月 28 日
detvector = a.*d - b.*c

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by