Why my plotting curves exceed the loop index?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Sulaymon Eshkabilov
2021년 5월 25일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Target Computer Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!