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

11 visualizaciones (últimos 30 días)
MathWorks Support Team
MathWorks Support Team el 16 de Jun. de 2023
Respondida: MathWorks Support Team el 16 de Jun. de 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 コマンドを使用してコヒーレンスと影響円錐をプロットする方法を教えてください。

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 16 de Jun. de 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';
%%

Más respuestas (0)

Categorías

Más información sobre Wavelet Toolbox en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by