필터 지우기
필터 지우기

getting an error: ''unable to resolve the name handles.edit_t"

조회 수: 6 (최근 30일)
SWASTIK SAHOO
SWASTIK SAHOO 2021년 2월 14일
댓글: Jan 2021년 2월 14일
% General Parameters
t=str2double(get(handles.edit_t,'string'));
lattice=str2double(get(handles.edit_lattice,'String'));
%starting with 3D representation
% creating the necessary k-vectors for the calculation
k_x= linspace(-2*pi/(lattice), 2*pi/(lattice), 100);
k_y= linspace(-2*pi/(lattice), 2*pi/(lattice), 100);
[k_meshx,k_meshy]= meshgrid(k_x, k_y);
%Energy values with the preset parameters in 3D representation
energy_mesh=NaN([size(k_meshx,1), size(k_meshx,2),2]);
b1=2.13;
b2=1.138;
for a=1:size(k_meshx,1)
energy_mesh(:,a,1)=t*sqrt(3+2*cos(2*b1*k_meshy)+4*cos(b2*k_meshx)*cos(b1*k_meshy));
energy_mesh(:,a,2)=-t*sqrt(3+2*cos(2*b1*k_meshy)+4*cos(b2*k_meshx)*cos(b1*k_meshy));
end
% Graphic representation
set(handles.axes_mesh,'color','w')
set(handles.axes_mesh,'NextPlot','replace')
surf(k_meshx,k_meshy,real(energy_mesh(:,:,1)),'parent', handles.axes_mesh,'FaceAlpha',0.6)
set(handles.axes_mesh,'NextPlot','add')
hold on
surf(k_meshx,k_meshy,real(energy_mesh(:,:,2)),'parent', handles.axes_mesh,'FaceAlpha',0.6)
colormap('jet')
shading interp
% plot of brillouin zone (black) and triangular path (red) of the dispersion plot
plot3(2*pi/(sqrt(3)*lattice)*[1,0,-1,-1,0,1,1], 2*pi/(3*lattice)*[1,2,1,-1,-2,-1,1],'k-','Linewidth',2,'parent',handles.axes_mesh)
plot3(2*pi/(lattice*sqrt(3))*[0,1,1,0], 2*pi/(3*lattice)*[0,0,1,0],'r-','Linewidth',2,'parent',handles.axes_mesh)
hx=xlabel('k_x','parent', handles.axes_mesh);
hy=ylabel('k_y','parent', handles.axes_mesh);
hz=zlabel('E(k)','parent', handles.axes_mesh);
axis equal
grid off
hold off
  댓글 수: 1
Jan
Jan 2021년 2월 14일
The shown code fails in the 1st line already. Then the rest of the code is not useful to identify the problem.
What is handles in your code?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by