Info

This question is closed. Reopen it to edit or answer.

need a loop to plot 0 and 1 from column 4 that includes all rows

1 view (last 30 days)
klkfunction SAPAEncoder223()% SAPAEncoderMgr %
% SAPAEncoder223('c:\temp\SAPAEncoderMgrATMO.csv')
% Fields: Week, SOW, SIOU, Sys, NumAreas, AvgTropoQual, Avg Sats, AvglonoQual
%
%calls a function to grep file
SAPAEncoderMgrATMO c:\temp\SAPAEncoderMgr*.log
%loads the grep file of interest
dat=load('c:/temp/SAPAEncoderMgr.csv');
x = dat(:,2)/86400;% SOW; Seconds of Week convert to days
y = dat(:,3);% SIOU; Solution Issue Of Update
y1 = dat(:,4);% Sys; GPS or Glonass constellation
y2 = dat(:,6);% AvgTropoQual; Avgerage Tropo Quality
y3 = dat(:,7);% Avg Sats; Average of Satellites per constellation
y4 = dat(:,8);% 8 AvglonoQual; Average Iono Quality
% 2 constellations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure; %'SIOU','System Type'
yyaxis left
plot(x,y,'.-b','linewidth',1) % plotting time vs Solution Issue of Update
ylim([0 600])
ylabel ('SIOU')
hold on % lets you add 2 yaxis to the left
yyaxis right
plot(x,y1,'.-r','linewidth',1) % plotting GPS/GLO need to add loop
ylim ([0 2])
ylabel('Sys Type');
legend('SIOU','Sys Type');
grid on;
set(gca,'fontsize',12);
%Statistic Section
%meanstring = sprintf('Avg GPS # of Sats: %3.2f Avg GLO # of Sats: %3.2f',.... % don't for get a , at the end
%mean(d(:,5)), mean(d(:,9)));
xlabel('Time (UTC)');
%xlabelStr{1} = 'Time UTC(hrs)'; % array needed to have two x label titles
%xlabelStr{2} = meanstring; % # of Sat average info
%xlabel(xlabelStr); % plots xlabelStr
%ylabel('# of Sats');
title('SAPAEncoder')
set(gca,'Xtick',0:2:24)
set(gca,'XtickLabel',0:2:24)
xtickangle(60) % rotates the X tick values
%saveas(gcf,[1:end-4),'_SIOU_Sys.png']);
saveas(gcf(),'c:\temp\_SIOU_Sys.png');
This is the data below after I dat=Load, I need to sort by column 4 and plot the data separately, it works now but all the data is plotted on 1 plot, its not what I need.....thanks
2053 339212.000 31 0 4 2.0000 7 1.2143 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 349994.000 31 1 4 2.0000 4 1.0000 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 339213.000 32 0 4 2.0000 7 1.2143 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 349995.000 32 1 4 2.0000 4 1.0000 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 339214.000 33 0 4 2.0000 7 1.2143 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 349996.000 33 1 4 2.0000 4 1.0000 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 339215.000 34 0 4 2.0000 7 1.2143 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 349997.000 34 1 4 2.0000 4 1.0000 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 339216.000 35 0 4 2.0000 7 1.2143 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 349998.000 35 1 4 2.0000 4 1.0000 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]
2053 339217. 000 36 0 4 2.0000 7 1.2143 %ATMO_MSG [week sow SIOU Sys NumAreas AvgTropoQual AvgSats AvgIonoQual]

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!