필터 지우기
필터 지우기

Can anyone please help me in plot of detaec' and taln. In this Iam getting error Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Ot

조회 수: 1 (최근 30일)
clear all;
q=1.6e-19;
E0=8.85e-12;
Ealgan=10.31;
Ealn=10.78;
fib=(5.1*1.6e-19);
sigmaaln=3.38e17;
detaec=0.862;
talgan=23e-9;
p=(q^2/Ealgan*E0);
taln=0:0.1:2.5;
m=length(taln);
for i=1:m
detaec'(i)=[detaec+(p*sigmaaln*taln(i))];
end
plot(taln,detaec'(1,:),'b')

채택된 답변

Sam Chak
Sam Chak 2022년 7월 2일
편집: Sam Chak 2022년 7월 2일
From your parameters, ThisTerm returns a vector of very small values, because of your chosen value in p.
If the initial value is detaec(1) = 0.862, then the final value is also detaec(26) = 0.862.
q = 1.6e-19;
E0 = 8.85e-12;
Ealgan = 10.31;
sigmaaln = 3.38e17;
detaec = 0.862;
p = ((q^2)/Ealgan)*E0 % the same as q^2 / Ealgan * E0
p = 2.1975e-50
taln = 0:0.1:2.5;
m = length(taln)
m = 26
ThisTerm = p*sigmaaln*taln;
plot(taln, ThisTerm)
  댓글 수: 2
Sam Chak
Sam Chak 2022년 7월 2일
The graph was to show only this term: p*sigmaaln*taln, that the product values are too small () in this range 0 ≤ taln ≤ 2.5. If you can show the mathematical formula for detaec, perhaps we can work this out. Don't give up.

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

추가 답변 (1개)

Raghav
Raghav 2022년 7월 2일
Error: Invalid expression. When calling a function or indexing a variable, use parentheses.
You are using detaec' as a variable name, Special symbols anywhere in a variable name are syntactically invalid in Matlab. So the name detaec2 can be used.
After correctly renaming the variable you will be recieving a straight line in plot, because of value of detaec2 being equal to detaec(i.e. 0.862) as in the expression:
detaec2(i)=[detaec+(p*sigmaaln*taln(i))];
The value of p*sigmaaln*taln(i) will be almost equal to zero as p=2.1975e-50. So for all i, detaec2(i) will be 0.862.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by