dividing each row by maximum value

조회 수: 15 (최근 30일)
kash
kash 2012년 8월 8일
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에서 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