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
2 views (last 30 days)
Show older comments
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')
0 Comments
Accepted Answer
Sam Chak
on 2 Jul 2022
Edited: Sam Chak
on 2 Jul 2022
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
taln = 0:0.1:2.5;
m = length(taln)
ThisTerm = p*sigmaaln*taln;
plot(taln, ThisTerm)
2 Comments
Sam Chak
on 2 Jul 2022
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.
More Answers (1)
Raghav
on 2 Jul 2022
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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!