An error Occur While I was COding in matlab,Attention Please I am in a - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

An error Occur While I was COding in matlab,Attention Please I am in a

weicellweicell Posts: 1Member
function [z,y,wmax,xmax]=Condition(A)
[m,n]=size(A); % Get the dimensions of A
w=ones(m,1); % Start with initial guess eigenvalues
imax=60;
tol=10^-10;
for i=1:imax
[kk,k]=max(abs(w)); % Returns the indices of the maximum w values in vector k
z=w/w(k); % Normalize w with respect to maxw=w(k)
w=A*z; % Calculate w again
wmax=w(k); % z(k)=1
r=norm(wmax*z-w); % Use Euclidean form (norm(w,p) = sum(abs(w).^p)^(1/p))
final=[i,wmax,r,z'];
if r
end

B=inv(A);
% Get the dimensions of A
x=ones(m,1); % Start with initial guess eigenvalue
for i=1:imax
[kk,k]=max(abs(x)); % Returns the indices of the maximum w values in vector k
y=x/x(k); % Normalize w with respect to maxw=w(k)
x=B*y; % Calculate w again
xmax=x(k); % z(k)=1
r=norm(xmax*y-x); % Use Euclidean form (norm(w,p) = sum(abs(w).^p)^(1/p))
final=[i,xmax,r,y'];
if r
end
end
end
xmin=1/xmax
wmax
condition=wmax*xmax

And An erro occurs;

Error in ==> Condition at 2
[m,n]=size(A); % Get the dimensions of A
How can I correct it?

Comments

Sign In or Register to comment.