Unrecognized function or variable 't' for three dimensional structure
2 次查看(过去 30 天)
显示 更早的评论
Hello all,
Somehow i am getting error for Unrecognized function or variable 't'. But i could not figure out why.
What is wrong in the code? As far as i see i have error in line i mention.
Vb1=0.5; %% Bariyer yüksekliği[eV]
WLt = 1.5e-9;
Rx = 5E-9;
Ry = 10E-9;
Rz = 15E-9;
x0=0;y0=0;z0=-WLt;
alfa = 1E-9;
w=1E+12; T=2*pi/w;
for i=1:numel(z)
for j=1:numel(y)
for k=1:numel(x)
fz = @(t) z(i) + alfa*sin(w.*t);
idx_QD = @(t) ((x(k)-x0)/Rx).^2 + ((y(j)-y0)/Ry).^2 + ((fz(t)-z0)/Rz).^2 < 1 ;
idx_QD(fz(t) < z0) = @(t) 0; %%%%% ERROR IS FROM THIS LINE %%%%%%%%%%%
idx_WL = (fz(t) < 0) & (fz(t) > -WLt);
idx =@(t) idx_QD(t) | idx_WL(t);
Vb =@(t) (idx(t))*0 + (1-idx(t))*Vb1 ;
V0(i,k,k) = (1/T).*integral(Vb,0,T);
end
end
end
0 个评论
采纳的回答
Walter Roberson
2023-2-23
idx_QD = @(t) (fz(t) >= z0).*(((x(k)-x0)/Rx).^2 + ((y(j)-y0)/Ry).^2 + ((fz(t)-z0)/Rz).^2 < 1);
idx_WL = @(t) (fz(t) < 0) & (fz(t) > -WLt);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!