How to plot multiple Y in the form of samples in the same X

7 vues (au cours des 30 derniers jours)
I have alot of samples with different X and Y, like this:
...and I want to plot one graphs with Y (samples) and X like this:
I know how to make this graph manually, but I have 350 samples... so it's kind hard. I can join every x with outerjoin, but i really don't know how can I plot.
  3 commentaires
Richard Perosa Fernandes
Richard Perosa Fernandes le 16 Avr 2018
I have 350 files of this style, like a1 a2 a..350. The y intesity doesn't matter if I would plot this manually, could look like a generic variable just to set the sample in the right spot: a1 = y = 1 a2 = y =2 The correct answer will be if y have the correspondent x data or not.
Richard Perosa Fernandes
Richard Perosa Fernandes le 16 Avr 2018
Like this example

Connectez-vous pour commenter.

Réponse acceptée

Shounak Shastri
Shounak Shastri le 16 Avr 2018
Modifié(e) : Shounak Shastri le 16 Avr 2018

Try this,

 plot(x1, y1, 'r*', x2, y2, 'yo', x3, y3, 'ks');

Here, I have taken (x, y) from a1 as (x1, y1), (x, y) from a2 as (x2, y2), and so on.

And then you can use

 legend('a1', 'a2', 'a3');

This will indicate the colours you have used to denote the values.

Best of luck.

  1 commentaire
Richard Perosa Fernandes
Richard Perosa Fernandes le 16 Avr 2018
Thanks shounak, I just replace every value of y with a generic number like 1 or 2 and the plot. Works like a charm.

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