Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
youbaa maa
youbaa maa 2019 年 2 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Omer Yasin Birey
Omer Yasin Birey 2019 年 2 月 5 日
Hi youbaa, tell us the line where you got this error please
Rena Berman
Rena Berman 2019 年 3 月 5 日
(Answers Dev) Restored edit

回答 (1 件)

KSSV
KSSV 2019 年 2 月 5 日
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