关于matlab特征系统幂法的程序
function[lambda,v,k]=mifa(a,x0,max,tol)%a是方阵,x0为初始列向量x=x0;fork=1:maxy=x/max(abs(x));x...
function [lambda,v,k]=mifa(a,x0,max,tol) %a是方阵,x0为初始列向量
x=x0;
for k=1:max
y=x/max(abs(x));
x=a*y;y1=x0/max(abs(x0));
x0=x;
if max(abs(y1-y))<tol ......line 7
break;
end
end
lambda=max(abs(x));
v=y;
??? Subscript indices must either be real positive integers or logicals.
Error in ==> D:\matlab6.5\work\mifa.m
On line 7 ==> if max(abs(y1-y))<tol
根本没有用数组,不会出现下标索引问题呀? 展开
x=x0;
for k=1:max
y=x/max(abs(x));
x=a*y;y1=x0/max(abs(x0));
x0=x;
if max(abs(y1-y))<tol ......line 7
break;
end
end
lambda=max(abs(x));
v=y;
??? Subscript indices must either be real positive integers or logicals.
Error in ==> D:\matlab6.5\work\mifa.m
On line 7 ==> if max(abs(y1-y))<tol
根本没有用数组,不会出现下标索引问题呀? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询