matlab5x5矩阵,帮忙用matlab求一下这个5X5矩阵的最大特征向量...

满意答案

dcebd7a0de6265b6ccae5ead692f1eab.png

565433fdf

2013.08.27

dcebd7a0de6265b6ccae5ead692f1eab.png

采纳率:49%    等级:12

已帮助:7012人

%file maxtr.m

function [mt,my]=maxtr(a,eps)

%a the matrix

%eps the accept error ,you decide it

%mt the maximum eigenvalue of the matrix

%my the corresponding eigenvector of mt

n=length(a);

x0=diag(ones(n));

k=1;

x=a*x0;

while norm(x-x0)>eps

k=k+1;

q=x;

y=x/maxnorm(x);

x=a*y;

x0=q;

end

mt=maxnorm(x);

my=y;

%%建立maxtr.m文件

%file maxnorm.m

function t=maxnorm(a)

%the maximum element of the array

n=length(a);

t=0;

for i=1:n

if abs(a(i)/max(abs(a)))>=1

t=a(i);

end

end

%%再建立maxnorm.m文件

运行

A=[1 8/5 8/7 2 8/9

5/8 1 5/7 5/4 5/9

7/8 7/5 1 7/4 7/9

1/2 4/5 4/7 1 4/9

9/8 9/5 9/7 9/4 1];

[mt,my]=maxtr(A,0.0001)

结果

mt =

5

my =

0.8889

0.5556

0.7778

0.4444

1.0000

00分享举报

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值