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')
0 个评论
采纳的回答
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
taln = 0:0.1:2.5;
m = length(taln)
ThisTerm = p*sigmaaln*taln;
plot(taln, ThisTerm)
2 个评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1053405/image.png)
更多回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!