필터 지우기
필터 지우기

HI, Following code generates 3 subplots for 3 different value of ik in 1 window , since the loop iterates ik= 1:3. I need to modify this peice of code to generate a single plot for variable Sum merging all three value of ik into one plot

조회 수: 1 (최근 30일)
Sum=0;
for ik=1:3
Image = S(ik)*((abs(Phi(:,:,ik)).^2));
Sum= Sum+Image;
subplot(3,1,ik);
mesh(fftshift(X),fftshift(Y), fftshift(abs(Sum)),'FaceColor','flat'); view(0,90);
xlim([-2,2]); ylim([-2,2]);
axis square;
xlabel('f_x');
ylabel('f_y');
title(sprintf('Kernel %d Mag',ik));
end

답변 (1개)

vijaya lakshmi
vijaya lakshmi 2018년 3월 19일
Hi Sagar,
I understand that you want to create a single plot for variable Sum merging all values of ik instead of a subplot for each possible ik.
You can use the command 'hold on' and 'hold off' instead of 'subplot' which retains plots in the current axes so that new plots added to the axes do not delete existing plots.
Here is the documentation link for hold
Hope this helps you.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by