Clear Filters
Clear Filters

Unrecognized function or variable 't' for three dimensional structure

2 views (last 30 days)
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

Accepted Answer

Walter Roberson
Walter Roberson on 23 Feb 2023
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);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!