Effacer les filtres
Effacer les filtres

plot x-axis data with discretize

5 vues (au cours des 30 derniers jours)
Ali Najem
Ali Najem le 18 Mai 2021
Commenté : Star Strider le 19 Mai 2021
Hello experts,
simple question ..
x = 0:2:24;
y= rand(1,13);
plot(x,y)
How can I plot x-axis where it would be like this (0,2,4,6,8 .......etc)?
thanks indeed..

Réponse acceptée

Star Strider
Star Strider le 18 Mai 2021
Perhaps something like this —
x = 0:2:24;
y= rand(1,13);
plot(x,y)
xticks(0:2:24) % 'xticks' Function Introduced In R2016b
xlim([min(x) max(x)]) % Optional
.
  2 commentaires
Ali Najem
Ali Najem le 19 Mai 2021
thanks alot, it worked.
Star Strider
Star Strider le 19 Mai 2021
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by