Matlab plot , skip every 9,10,19,20, etc

조회 수: 2 (최근 30일)
RuiQi
RuiQi 2015년 4월 8일
편집: RuiQi 2016년 7월 7일
Hello forum
I have a vector of 160 values and would like to plot them but leave 2 unit spacing every 8 values. How can i achieve that ?

채택된 답변

Star Strider
Star Strider 2015년 4월 8일
One approach:
V = rand(1, 160)+1; % Create Data
Vm = reshape(V, 10, []); % Create Temporary Matrix
Vm([9, 10],:) = NaN; % Insert NaNs In Last 2 Rows
figure(1)
plot([1:160], Vm(:)) % Plot
grid
axis([xlim 0 3])

추가 답변 (1개)

RuiQi
RuiQi 2015년 4월 8일
Wow that is fast. Thanks !

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by