wcoherence​のプロットにおいて、​位相の矢印を非表示に​する方法はありますか​?

11 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 16 Juin 2023
>> doc wcoherence
ドキュメントでは、 [wcoh,~,period,coi] = wcoherence(x,y,ts); の場合に
pcolor コマンドを使用してコヒーレンスと影響円錐をプロットする方法を説明しています。
私は、[wcoh,wcs,f] = wcoherence(x,y,fs) の場合に pcolor コマンドを使用してコヒーレンスと影響円錐をプロットする方法を知りたいと考えています。
私は、プロットに位相矢印を含めることを望んでいません。
[wcoh,wcs,f] = wcoherence(x,y,fs) の場合に、pcolor コマンドを使用してコヒーレンスと影響円錐をプロットする方法を教えてください。

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 16 Juin 2023
下記2つの方法例をご紹介します。
1) 
%% 周波数軸を線形に表示する
rng default
t = 0:0.001:2;
x = cos(2*pi*10*t).*(t>=0.5 & t<1.1)+...
  cos(2*pi*50*t).*(t>= 0.2 & t< 1.4)+0.25*randn(size(t));
y = sin(2*pi*10*t).*(t>=0.6 & t<1.2)+...
  sin(2*pi*50*t).*(t>= 0.4 & t<1.6)+ 0.35*randn(size(t));
% Return COI as output argument
[wcoh,wcs,f,coi] = wcoherence(x,y,1000);
h = pcolor(t*1000,f,wcoh);
h.EdgeColor = 'none';
hold on
plot(t*1000,coi,'w--','LineWidth',1.5)
ax = gca;
ax.XLabel.String='Time [msec]';
ax.YLabel.String='Frequency[Hz]';
ax.Title.String = 'Wavelet Coherence';
hcol = colorbar;
hcol.Label.String = 'Magnitude-Squared Coherence';
% ログスケーリングが必要な場合は、次のようにします。
ax.YScale = 'log';
%%
2) 2をベースとして、すべてをログスケールで表示する
%%
rng default
t = 0:0.001:2;
x = cos(2*pi*10*t).*(t>=0.5 & t<1.1)+...
  cos(2*pi*50*t).*(t>= 0.2 & t< 1.4)+0.25*randn(size(t));
y = sin(2*pi*10*t).*(t>=0.6 & t<1.2)+...
  sin(2*pi*50*t).*(t>= 0.4 & t<1.6)+ 0.35*randn(size(t));
% Return COI as output argument
[wcoh,wcs,f,coi] = wcoherence(x,y,1000);
figure
h = pcolor(t*1000,log2(f),wcoh);
h.EdgeColor = 'none';
hold on
plot(t*1000,log2(coi),'w--','LineWidth',1.5)
ax = gca;
ax.XLabel.String='Time [msec]';
ax.YLabel.String='log2(Frequency)[Hz]';
ax.Title.String = 'Wavelet Coherence';
hcol = colorbar;
hcol.Label.String = 'Magnitude-Squared Coherence';
%%

Plus de réponses (0)

Catégories

En savoir plus sur Wavelet Toolbox dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by