MATLAB Answers

Change all matrix elements from x to 1/x

78 views (last 30 days)
Hello, i am trying to change all the elements in a single line matrix from Xj to 1/Xj. Thanks

Accepted Answer

Rik on 12 Jun 2018
Use a dot for element-wise division and multiplication.

Sign in to comment.

More Answers (1)

Asieh Daneshi
Asieh Daneshi on 25 Apr 2020
  1 Comment
Walter Roberson
Walter Roberson on 25 Apr 2020
This would change a single column, rather than a single line (row). It happens to change the last column, by the way.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by