フィルターのクリア

How can I divide elements of matrix in every dimension

1 回表示 (過去 30 日間)
fatema saba
fatema saba 2015 年 2 月 2 日
コメント済み: fatema saba 2015 年 2 月 2 日
Hello I have a question please.
I have a 3D matrix named dd
dd(:,:,1) =
1 0 1
0 1 1
dd(:,:,2) =
1 1 0
0 0 1
dd(:,:,3) =
1 0 0
0 0 1
also I have matrix w that is summation of elements in every dimension:
w=sum(sum(dd))
w(:,:,1) =
4
w(:,:,2) =
3
w(:,:,3) =
2
I want to create matrix c in which the amount of each element is the result of each element of d that is divided to amount of w in the same dimension.
I mean something like:
c=dd./w
Thanks

採用された回答

Matt J
Matt J 2015 年 2 月 2 日
編集済み: Matt J 2015 年 2 月 2 日
c=bsxfun(@rdivide,dd,w)

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by