I'm given the equation . This can also be written as . Where where and is a 2x1 matrix with initial value of . I need to solve this problem analytically with Euler method, I've already solved it numerically. I need to plot time vs. intensity.
my code attempt is as follows:
H=[(gamma*i) -1;-1 -i*gamma];
I keep getting the error 'Unable to perform assignment because the left and right sides
have a different number of elements.' for line 36: y(n+1)=n*y(n)+deltat*(-i*H*psi);
I am very confused by this and could use the help!