# How to skip zeros values form a matrix and plot with a time values?

3 visualizzazioni (ultimi 30 giorni)
Rajeev Kumar il 26 Set 2022
Risposto: Simon Chan il 26 Set 2022
I have a two array
A = [1,2,3,4,0,6,7,0,9,10,11,0,13,14,15];
t=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
Now skip the zeros form the array A and also skip the crossponding index form the time (t) array. and make a plot in between them?
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Simon Chan il 26 Set 2022
You may put those zero to NaN and plot it. It will skip those points.
A = [1,2,3,4,0,6,7,0,9,10,11,0,13,14,15];
t=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
A(A==0)=NaN;
plot(t,A);
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Line Plots in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by