# what does "X = X./max(max(X))" means?>

7 views (last 30 days)
Matlaber on 12 Mar 2019
Commented: Abdulmanan Butt on 13 Mar 2019
>> X=[1,2,3,4]
X =
1 2 3 4
>> X = X./max(max(X));
>> X
X =
0.2500 0.5000 0.7500 1.0000
>>
I understand from the output, but what does "./" means?

Stephan on 12 Mar 2019
Edited: Stephan on 12 Mar 2019
Hi,
the dot means an elementwise operation. See here:
Best regards
Stephan
##### 3 CommentsShow 1 older commentHide 1 older comment
Stephan on 12 Mar 2019
Edited: Stephan on 12 Mar 2019
try this:
A=magic(3)
b = [2,4,5]
result1 = A/b
result2 = A./b
or
A=magic(3)
b = [1 -2 3; -4 -5 -6; 7 8 -9]
A/b % mrdivide
A./b % rdivide
Matlaber on 12 Mar 2019
thanks!
"./" is element by element, one element by one element

Matlaber on 12 Mar 2019

Abdulmanan Butt on 13 Mar 2019
Edited: Abdulmanan Butt on 13 Mar 2019
Hi,
It means,
You are dividing X matrix (element-wise) with the element of matrix X having maximum value.
Like in this case, max(X) or max(max(X)) will be 4, and you are going to divide matrix X with that 4, Where 4 will be divided to each element of matrix X in this element-wise division case, So you got the final result,
X= 0.2500 0.5000 0.7500 1.0000
Regards,
Abdulmanan Butt
Matlaber on 13 Mar 2019
Thanks. I got it.
"." means element by element, usually one by one
Abdulmanan Butt on 13 Mar 2019
Yes..!!
Welcome.