Why my plotting curves exceed the loop index?

Why I see three plotting curves while my loop index j runs twice?
close all;
clear all;
clc;
%% ------------------------------Program-------------------------------------
z=2860:11:3135;
FOV=[1 2];
n=2;
col=['r' 'b'];
[m,~]=size(n);
lineHandles = gobjects(1,m);
for i=1:length(FOV)
for j=1:n
figure (3),
hold on
I0= getsignal([num2str(j),'FOV_',num2str(FOV(i)),'mrad\out_resultsG_I0.dat']);
Q0= getsignal([num2str(j),'FOV_',num2str(FOV(i)),'mrad\out_resultsG_Q0.dat']);
I(i,:)= smooth(sum(I0,2));
Q(i,:)= smooth(sum(Q0,2));
dep(i,:)= (I(i,:)-Q(i,:))./(I(i,:)+Q(i,:));
depr(i,:)=(dep(1,:)./dep(2,:));
plot(depr(i,:),z,'LineWidth',1.5,'color',col(:,j));
title('\fontname{Arial}Inhomogeneous clouds','Fontsize',12);
%legend('\delta_{in}/\delta_{out}','location','Southeast');
legend('CM1','CM2','location','Southeast');
xlabel('Depolarization ratio \delta_{rat}');
ylabel('\fontname{Arial}Cloud depth (m)');
set(gca,'color','w','Fontsize',12,'LineWidth',1,'Fontweight','normal');
set(gca,'box','off','Fontname','Arial','Fontsmoothing','on');
set(gca,'xlim',[0 1.6],'xtick',[0:0.2:1.6],'ylim',[2850 3150],'ytick',[2850:60:3150]);
set(gca,'xgrid','on','ygrid','on','gridcolor','k')
end
end

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 5월 25일

0 개 추천

Hi,
There might be a couple or more possible cases. Presumably (preassumption without seeing your data), one of your imported data sets contains two sets of data instead of one.
Don'r foget to use hold off as well once all done. This could be another possible case scenario.

댓글 수: 1

Thank you for your comment. I have almost solved it.

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

카테고리

도움말 센터File Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

질문:

2021년 5월 25일

댓글:

2021년 5월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by