Plotting an equation with Matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi I will plot T(E)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193904/image.gif)
where K2 is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193905/image.gif)
h=1.36e-34
clc
clear all
m=1.6e-18;
U=5e-19;
E=10e-19:0.1:20e-19;
a=1e-9;
h=1.36e-34;
k=sqrt(2*m.*(E-U));
k2=k/h; c=(U^2)*(sin(0.5*a*k2).^2)./(4*E.*(E-U))
T=1./(1+c);
plot(E,T)
But I see an empty plot!
Can someone help me please ?
댓글 수: 0
답변 (1개)
TADA
2018년 11월 5일
편집: TADA
2018년 11월 5일
Your problem is the initialization of E you did:
E=10e-19:0.1:20e-19;
your interval is 17 orders of magnitude higher than the values, so you get a scalar instead of a vector
you should use an interval of the same order of magnitude or less
E=10e-19:0.1e-19:20e-19;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!