Storing decimal numbers in for loop: getting a single vector
Show older comments
I want to store decimal numbers in the for loop.
for e = 0:0.1:1
k = sqrt(2.*e);
q = sqrt(2.*(e+(V0./2)));
r = sqrt (2.*(e+V0));
a = ((r+q+(2.*s1.*lambda)).*(k+q+(2.*s1.*lambda)).*expm(s1.*(r-q).*0.48)) - ((r-q+ (2.*s1.*lambda)).*(k-q+2.*s1.*lambda).*expm(s1.*(r+q).*0.48));
Trans = (4.*k.*q)./a;
wfn = Trans.*conj(Trans);
posit1(e,1) = e;
wfn1(e,1) = wfn;
end
plot( posit1, wfn1);
I want to store all the values from 0 to 1 with an interval of 0.1 Please help me how to do it??
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!