dividing each row by maximum value

5 次查看(过去 30 天)
I have a matrix
A= [40.8 3 3.6 3.5 7.4
285 36.3 75 8.4 133
42 62 5 63 73
260 130 29 84 92
23 12 12 10 61
528 3179 320 3020 2314]
In this first i have to divide every element by the maximum value in that row for example ,the first row maximum value is 40.8 so the first row must be divided by 40.8
In the 2nd row the maximum value is 285 so every value in 2nd row must be divided by 285
as like i want to do for all rows please help

采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-8-8
out = bsxfun(@rdivide,A,max(A,[],2));

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by