Squaring a matrix and how the results matters

2 views (last 30 days)
az
az on 27 Nov 2018
Commented: az on 27 Nov 2018
What is the absolute right way to square a metrix: say, A = rand (3,1) and I want absolute value
  1. abs (A' *A)
  2. abs (A)^2
  3. abs ((A).^2)
  4. abs (A .*A)
  5. abs(A*A)
I know sounds sily. just try to be sure. Thanks.

Answers (1)

madhan ravi
madhan ravi on 27 Nov 2018
  1 Comment
az
az on 27 Nov 2018
Thanks Ravi, I have checked those links. Now I just want to sure what it means in matlab code to square any matrix? Is it just write the matrix side by side, or transpose first one then write side by side and multiply.
If it is a matrix not array.

Sign in to comment.

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!