plot complex eigenvalues over time

2 ビュー (過去 30 日間)
Douglas Bowman
Douglas Bowman 2022 年 1 月 5 日
コメント済み: Chunru 2022 年 1 月 8 日
Given an 1584 x 8 matrix of 8 complex eigenvalues varying over 1584 time steps, I'd like to plot them together in maybe a 3-d plot? This will allow me to see how all eigenvalues change with time, all on one plot.
Thank you for your help
Doug

回答 (1 件)

Chunru
Chunru 2022 年 1 月 6 日
編集済み: Chunru 2022 年 1 月 8 日
n = 20;
x = (3+randn(n,8)) + 1i*(2+randn(n, 8)); % generate some data 20x8 instead of 1584 x 8
cmap = jet(n);
% use different color for different time
figure
hold on
for i=1:n
plot3(real(x(i,:)), imag(x(i, :)), i*ones(1,8), 'o','Color', cmap(i,:));
end
box on
grid on
xlabel('Real'); ylabel('Imag'); zlabel('Time')
view(3)
figure
% Use color to reprenset eigen values
m = 8
m = 8
cmap = jet(m);
% use different color for different time
figure
hold on
for j=1:m
plot3(real(x(:,j)), imag(x(:, j)), (1:n), 'o','Color', cmap(j,:));
end
box on
grid on
xlabel('Real'); ylabel('Imag'); zlabel('Time')
view(3)
  2 件のコメント
Douglas Bowman
Douglas Bowman 2022 年 1 月 6 日
Thank you Chunru. I have modified your code for my system and it works:
n=1584
cmap = jet(n)
% use different color for different time
figure
hold on
for i=1:n
plot3(real(eigs_Asys(i,:)),imag(eigs_Asys(i,:)), i*ones(1,8), '.','Color', cmap(i,:));
%plot3(real(x(i,:)), imag(x(i, :)), i*ones(1,8), 'o','Color', cmap(i,:));
end
box on
grid on
xlabel('Real'); ylabel('Imag'); zlabel('Sample')
view(3)
Instead of using different colors for different time I'd like to use different color for the 8 different eigenvalues. How can I modify the code to perform to do this?
Thanks, Doug
Chunru
Chunru 2022 年 1 月 8 日
See above.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by