How introduce column vector in M-file?
Show older comments
how I improved my file to get { temp1<<1}, I am stuck here.
i gto sugestion to introduce column vector for temp0 but i am fail in this stage
7 Comments
Walter Roberson
on 19 Feb 2023
ket = sum(tmpI(:,2:D),2);
The sum over the second dimension of a 2d array is going to be a column vector.
temp0 = symsum(exp(-abs(alpha(k))^2 * alpha(k)^n / sqrt(factorial(n)) ), n, 0, 14)*ket;
symsum of a scalar expression is going to give a scalar result. You then multiply by the column vector, and that will give you a column vector result.
It therefore appears that your temp0 is already a column vector.
Abu Zar
on 19 Feb 2023
Abu Zar
on 19 Feb 2023
Image Analyst
on 19 Feb 2023
whos temp1
What does that show? Does it show many rows and 1 column?
Abu Zar
on 19 Feb 2023
Walter Roberson
on 19 Feb 2023
double() or vpa()
The exp() terms I tested were exp(-1e-9) to exp(-1e-15). Precision is low in that range but the values should be distinguishable from 1.
Accepted Answer
More Answers (0)
Categories
Find more on Quantum Mechanics 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!


