divide the entries in the column by entries from another column

23 次查看(过去 30 天)
Hi,
I have five arrays lets say A, B , C , D, E of size 100x 3.
Here, For instance, I have to divide entries in the second column of A by sum of entries in the second column of A, B , C , D , E
Something like this
AA = A (:,2)/ ( A(:,2) + B(:,2) + C(:,2) + D(:,2) + E(:,2))

采纳的回答

Voss
Voss 2022-4-8
Use element-wise division ( ./ ) and you'll have it:
AA = A(:,2) ./ ( A(:,2) + B(:,2) + C(:,2) + D(:,2) + E(:,2) )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by