Steepest Descent Method COde

6 ビュー (過去 30 日間)
SANDIPKUMAR ROYADHIKARI
SANDIPKUMAR ROYADHIKARI 2020 年 11 月 4 日
コメント済み: Walter Roberson 2020 年 11 月 4 日
I wrote a code on Steepest Decsent Method, with 550 X 550 random number matrix
M=rand(550);
P=0.5*(M+M');
N= sum(P,2);
D=abs(diag(P));
W=N-D;
A = P - diag(diag(P)) + diag(W);
X=(1:550)';
b=A*X;
x=zeros(550,1);
t=1e-7;
res=1;
count=1;
i=1;
while res>t
r=b-A*x;
p=r'*r/(r'*A*r);
x=x+p*r;
res(i)=norm(r);
i=i+1;
end
Someone please tell me if it is correct it or not ?
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 4 日
Steepest descent implies that you have a function being evaluated, but it is not clear what the function is. Something about eigenvalues? eigenvalues of a random matrix??

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by