Reducing the number of data points on the grapth
조회 수: 32 (최근 30일)
이전 댓글 표시
Hello How can i reduce the number of data points for every graph? I want the line to be plotted with the original number of data points but the marker should skip every second point.
I'm doing it like this.
clear variables;
close all;
clc;
%%loading the data files.
datafiles4={'Dualhop_TM_OFF_RD_OFF.mat','Dualhop_TM_OFF_RD_On.mat','Dualhop_TM_On_RD_OFF.mat','Dualhop_TM_ON_RD_ON.mat'};%,
% plotting the results one after another.
for scheme=1:numel(datafiles4)
load(datafiles4{scheme});
colorset=['-sg';'-ko';'-r>';'-b*'];
figure(1);
hold on;
grid on;
box on;
Power_Consumption_Rating_Store_hbs=Power_Consumption_Rating_Store_hbs/1e-9;
plot(total_offer_traffic,Power_Consumption_Rating_Store_hbs,colorset(scheme,:),'LineWidth',2);
title('Power Consumption Rating for HBS');
xlabel('Offered Traffic (Gbps)');
ylabel('Power Consumption Rating (nW per bit)');
legend('TM-Off & RD-Off','TM-Off & RD-On','TM-On & RD-Off','TM-On & RD-On','location','southEast');
hold off;
end
댓글 수: 0
답변 (1개)
Walter Roberson
2018년 3월 9일
If you have a relatively recent MATLAB then see https://www.mathworks.com/examples/matlab/mw/graphics-ex58554486-control-placement-of-markers-along-line
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!