Subplot a mosaic of spectrogram

조회 수: 2 (최근 30일)
Martina Clairand
Martina Clairand 2021년 5월 18일
댓글: Adam Danz 2021년 5월 18일
Hello,
I woud like to plot many spectrograms (as the attached one) on a single figure by using a for loop. I was using the following code but it doesn't work:
NumbofSignals=4
for k=1:NumbofSignals
h(k) = figure ;
wcoherence(Y{1},Y{k}, 1000)
f2 = figure;
subplot(2,NumbofSignals,k);
h(k);
end
Do you have any idea on how to do this?
Thank you in advance for your answer!
  댓글 수: 1
Adam Danz
Adam Danz 2021년 5월 18일
Every time you call figure() a new figure is generated, unless you're calling a specific existing figure. I don't know what your code is supposed to be doing but if you want the loop to act on the same figure, this is how it should be structured,
NumbofSignals=4
figure
hold on
for k=1:NumbofSignals
wcoherence(Y{1},Y{k}, 1000)
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by