How to extract specific data?

1 visualización (últimos 30 días)
hj lee
hj lee el 6 de Oct. de 2020
Comentada: Star Strider el 6 de Oct. de 2020
Hello,
a1 = [10 20 30 40 50 60];
b1 = [11 21 31 41 51 61];
c1 = [12 22 32 42 52 62];
  1. I want to extract specific data such as
A1 = [10 11 12]
B1 = [20 21 22]
C1 = [30 31 32]
....
F2 = [60 61 62]
and plus,
2. e = [0 3 6];
I want to figure A1,B1,C1,....F1 in one figure,
plot(e,A1,e,B1,.....)
but it has too much groups(A1,B1,C1,...) , so I can't use 'hold on' and plot each group or array each groups.
Could someone know how to plot all groups at one figure?
Thanks for helping me.

Respuesta aceptada

Star Strider
Star Strider el 6 de Oct. de 2020
Try this:
a1 = [10 20 30 40 50 60];
b1 = [11 21 31 41 51 61];
c1 = [12 22 32 42 52 62];
e = [0 3 6];
abc = cat(1, a1, b1, c1);
figure
plot(e, abc, '-x')
grid
producing:
  2 comentarios
hj lee
hj lee el 6 de Oct. de 2020
Thank you very much!
Star Strider
Star Strider el 6 de Oct. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by