Raise the elements of a matrix to a power.

조회 수: 33 (최근 30일)
Ricardo Gutierrez
Ricardo Gutierrez 2020년 1월 20일
댓글: Ricardo Gutierrez 2020년 1월 21일
Hello good day.
I have a power with a value of 3 with name b, ((b = 3)) and I have a "min" array:
min = [1 2 3 4 5
          2 3 8 1 4
          4 1 4 4 4];
How to raise each and every one of the elements of the "min" matrix to exponent 3?
to get this way:
           1 8 27 64 125
           8 27 512 1 64
           64 1 64 64 64
I would appreciate your valuable help
Thank you

채택된 답변

David Goodmanson
David Goodmanson 2020년 1월 20일
편집: David Goodmanson 2020년 1월 20일
Hi Ricardo,
min3 = min.^3
It's not a good idea to name a variable 'min' because that is the name of a built-in Matlab function.
  댓글 수: 1
Ricardo Gutierrez
Ricardo Gutierrez 2020년 1월 21일
Thank so much.
I will change the name ¨min¨

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by