How to extract specific data?

1 view (last 30 days)
hj lee
hj lee on 6 Oct 2020
Commented: Star Strider on 6 Oct 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.

Accepted Answer

Star Strider
Star Strider on 6 Oct 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 Comments
hj lee
hj lee on 6 Oct 2020
Thank you very much!
Star Strider
Star Strider on 6 Oct 2020
As always, my pleasure!

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!