フィルターのクリア

Unrecognized function or variable 't' for three dimensional structure

2 ビュー (過去 30 日間)
Özgür Alaydin
Özgür Alaydin 2023 年 2 月 23 日
コメント済み: Özgür Alaydin 2023 年 2 月 23 日
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

採用された回答

Walter Roberson
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 ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by