How do you define symbolic variables k, α, β, γ for eigenvalue calculation in MATLAB?

  • Context: MATLAB 
  • Thread starter Thread starter quansnow
  • Start date Start date
  • Tags Tags
    Eigenvalues Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 3K views
quansnow
Messages
3
Reaction score
0
I use the command eig(A) to calculate the eigenvalues of the matrix A, in which k,α,β,γ are variables,

A=[-0.5*k -i*α 0;-i*α -0.5*γ -i*β;0 i*β -0.5k];
eig(A)

but the MATLAB shows "Undefined function or variable 'k'."
I don't know how to define the variables k,α,β,γ.
Can anyone tell me how to do it? Thanks!
 
Physics news on Phys.org
It works. Thanks a lot!