Info
この質問は閉じられています。 編集または回答するには再度開いてください。
i need help with this message undefined function or variable matlab even the vqriqble excite
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
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
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!