how do you find the roots with zero real part of a 1x3001 complex matrix in matlab without using roots or eig functions in matlab

To find the roots with zero real part of a 1x3001 complex matrix in MATLAB without using the roots or eig functions, we need to perform the following steps:

  1. Extract the coefficients of the polynomial from the complex matrix.
  2. The roots with zero real part will be the solutions of the equation P(z) = 0 where P(z) represents the complex polynomial.

Here is a sample code snippet that demonstrates this process for a 1x5 complex matrix:

main.m
% Sample complex 1x5 matrix
A = [2+1i, -3-2i, 1+3i, -4-2i, 5+6i];

% Extract coefficients of the polynomial
coeff = fliplr(A); % Reverse the order of elements

% Define the symbolic variable
syms z

% Define the polynomial P(z)
P = 0;

for i = 1:numel(coeff)
    P = P + coeff(i) * z^(i-1);
end

% Find the roots with zero real part
zero_real_roots = solve(real(P) == 0);

disp(zero_real_roots);
396 chars
21 lines

You can extend this approach to a 1x3001 complex matrix by modifying the size and values within the matrix while following the same steps outlined in the code snippet above.

related categories

gistlibby LogSnag