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
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')
Accepted Answer
More Answers (1)
Raghav
on 2 Jul 2022
0 votes
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.
Categories
Find more on Scripts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
