Why my plotting curves exceed the loop index?

1 回表示 (過去 30 日間)
Wiqas Ahmad
Wiqas Ahmad 2021 年 5 月 25 日
コメント済み: Wiqas Ahmad 2021 年 5 月 25 日
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 日
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 件のコメント
Wiqas Ahmad
Wiqas Ahmad 2021 年 5 月 25 日
Thank you for your comment. I have almost solved it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTarget Computer Setup についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by