Error in matrix power

1 回表示 (過去 30 日間)
Hello Matlab
Hello Matlab 2015 年 4 月 21 日
回答済み: Star Strider 2015 年 4 月 21 日
I'm getting this error in my below code:
Error: Line: 6 Column: 9 The expression to the left of the equals sign is not a valid target for an assignment.
The code:
load M.dat
t = 870;
C = M^t;
for i=1:t-1,
h=i+1;
M^h = M^i*M; & line 6
end

回答 (1 件)

Star Strider
Star Strider 2015 年 4 月 21 日
In this line:
M^h = M^i*M; & line 6
you can’t have any mathematical operation to the left of the equal sign. Perhaps you meant:
M = (m^i*M)^(1/h);

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by