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

2 Ansichten (letzte 30 Tage)
RuiQi
RuiQi am 8 Apr. 2015
Bearbeitet: RuiQi am 7 Jul. 2016
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 ?

Akzeptierte Antwort

Star Strider
Star Strider am 8 Apr. 2015
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])

Weitere Antworten (1)

RuiQi
RuiQi am 8 Apr. 2015
Wow that is fast. Thanks !

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by