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 件のコメント
Nudrat Sufiyan
Nudrat Sufiyan 2022 年 7 月 2 日
Thankyou very much sir, but this graph is not correct
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 Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by