Upgrade MATLAB from r2013b to r2017b problem.....

조회 수: 2 (최근 30일)
Atique Khan
Atique Khan 2020년 6월 2일
댓글: Image Analyst 2020년 6월 6일
I had a code prepared in MATLAB version r2013b , I upgraded my MATLAB version to r2017b and the same program that executed quite smoothly in the prevoius version now gives the follwoing error....
Error using ^
One argument must be a square matrix and the other must be a scalar. Use POWER (.^) for elementwise power.
The question is that either its just due to the change of vesion or either I was getting wrong results prevoiusly. (Previously for r2013b I rechecked all parameter values uisng Mathematica and both were same)
Kindly anyone help in this capacity.
  댓글 수: 1
Image Analyst
Image Analyst 2020년 6월 6일
Huh? The let you "upgrade" your program to a 2.5 year old program, instead of the latest release? Why??? Why not just upgrade to the latest release?

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

채택된 답변

drummer
drummer 2020년 6월 2일
I don't know when element-wise operation was released nor it always has been there.
A = [1, 2; 3, 4]
B = A^2
C = A.^2
Notice that B and C are not the same.
A^2 = A*A
A.^2 = [1^2, 2^2; 3^2, 4^2].
If your case is the multiplication of a matrix by a scalar, you can always check if the result is the same.
A*3
A.*3
You can also check if you typed ˆ or ^.
The second one is the right one.
Ex:
Aˆ2 will get you the error.
A^2 is fine.
Cheers

추가 답변 (1개)

Star Strider
Star Strider 2020년 6월 2일
Much changed in those four years, specifically in R2014b and R2016b. (that introduces implicit array expansion).
You now need to Contact Support to get the release notes for R2014b (that were taken offline a few weeks ago) that introduced a number of significant changes in handle graphics.
Have fun updating your code!

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by