I understand that you would like to determine the values of "w" that satisfy the equation, (-w²M + C iw + K)=0. However, in order to better understand your question and provide you with a suggestion, please provide me some more information :
1. What is your use case ? What physical system are you modelling ?
2. What is the end goal that you are trying to achieve ?
3. As mentioned in the post, (-w²M + C iw + K) is the determinant of a matrix. Could you please let me know what matrix it is and how you are defining it ?
4. Please also provide me the exact values of M, C and K, and how you are initializing them.
In general, the unknowns values that make the determinant 0 are the roots of the characteristic equation and are the eigenvalues. To calculate eigenvalues, you may use the "eig" function as given in the following documentation: