Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

i need help with this message undefined function or variable matlab even the vqriqble excite

1 vue (au cours des 30 derniers jours)
youbaa maa
youbaa maa le 5 Fév 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
I have this code when i run the function ,I am receiving the following error message,Undefined function or variable A,how can I resolve this issue?
this is the message
Undefined function or variable 'A'.
Error in T (line 21)
df=(sum(sum(A))^-1);
function [teta]=T(X)
global n m
p1=1;
p2=2;
t=1;
for i=2:n
for j=2:m
k=1;
vect=zeros(4,1);
for h=0:p1
for l=0:p2
vect(k)=X(i-h,j-l);
k=k+1;
end
end
f(t,:)= vect(2:4)
A(t)= vect(2:4)'*vect(2:4)
t=t+1;
end
end
df=(sum(sum(A))^-1);
t=0;
for i=2:n
for j=2:m
t=t+1;
g(t,:)=f(t,:)*X(i,j);
end
end
teta=df*sum(g);
end
  3 commentaires
Omer Yasin Birey
Omer Yasin Birey le 5 Fév 2019
Hi youbaa, tell us the line where you got this error please

Réponses (1)

KSSV
KSSV le 5 Fév 2019
function [teta]=T(X,n,m)
p1=1;
p2=2;
t=1;
for i=2:n
for j=2:m
k=1;
vect=zeros(4,1);
for h=0:p1
for l=0:p2
vect(k)=X(i-h,j-l);
k=k+1;
end
end
f(t,:)= vect(2:4)
A(t)= vect(2:4)'*vect(2:4)
t=t+1;
end
end
df=(sum(sum(A))^-1);
t=0;
for i=2:n
for j=2:m
t=t+1;
g(t,:)=f(t,:)*X(i,j);
end
end
teta=df*sum(g);
end

Community Treasure Hunt

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

Start Hunting!

Translated by