Array Division

48 ビュー (過去 30 日間)
Yün Han
Yün Han 2011 年 12 月 20 日
When I entered two arrays,
u = [1 2 3 4];v = [5 6 7 8];
and did the division using,
u/v
I got,
ans = 0.4023.
How to interpret the answer and what's the definition of array division like 'u/v' rather than element-wise 'u./v'?
Thanks.

採用された回答

C.J. Harris
C.J. Harris 2011 年 12 月 20 日
Usually u/v is equal to u*inv(v) in matrix terms.
However, since v does not have an inverse Matlab will calculate the Moore-Penrose pseudoinverse of v instead. This can also be done directly:
u*pinv(v) = 0.4023

その他の回答 (2 件)

Malcolm Lidierth
Malcolm Lidierth 2011 年 12 月 20 日
Were you expecting this?
>> u = [1 2 3 4];v = [5 6 7 8];
>> u./v
ans =
0.2000 0.3333 0.4286 0.5000
Note the "." in
"./"

Sean de Wolski
Sean de Wolski 2011 年 12 月 20 日
doc mrdivide
is a good place to start.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by