Plotting 2D Sensor data with the same value on X-axis

19 views (last 30 days)
Hi, I got the series of variable measurement from many points. So that, in one point of x-axis, there will be more more values existed. Below is the data example A B C -78 -77 -91 -77 -77 -90 -75 -77 -91 -78 -77 -92 -77 -77 -91 -76 -77 -91 -78 -77 -90 -78 -77 -91 -78 -77 -90 -76 -77 -88 -79 -77 -89 -77 -77 -92 -77 -77 -92 -77 -77 -90 -78 -77 -91 -78 -77 -92 -77 -77 -96 -77 -77 -94 -78 -77 -96 -78 -77 -92 -78 -77 -92 -79 -77 -91 -79 -77 -92 -79 -77 -89 -80 -77 -90 -79 -77 -88 -78 -77 -95 -77 -77 -92 -77 -77 -90 -79 -77 -91 -77 -77 -88 -78 -77 -90 -78 -77 -90 -78 -77 -96 -79 -77 -90 -77 -77 -87
I want to plot all the data with three categories A,B, and C. I start to try with plot (x,y), but I have no x in this date, except the categories.

Accepted Answer

Star Strider
Star Strider on 13 Nov 2017
I am not certain what you want.
Try this:
C = { 'A' 'B' 'C'};
V = [-78 -77 -91
-77 -77 -90
-75 -77 -91
-78 -77 -92
-77 -77 -91
-76 -77 -91
-78 -77 -90
-78 -77 -91
-78 -77 -90
-76 -77 -88
-79 -77 -89
-77 -77 -92
-77 -77 -92
-77 -77 -90
-78 -77 -91
-78 -77 -92
-77 -77 -96
-77 -77 -94
-78 -77 -96
-78 -77 -92
-78 -77 -92
-79 -77 -91
-79 -77 -92
-79 -77 -89
-80 -77 -90
-79 -77 -88
-78 -77 -95
-77 -77 -92
-77 -77 -90
-79 -77 -91
-77 -77 -88
-78 -77 -90
-78 -77 -90
-78 -77 -96
-79 -77 -90
-77 -77 -87];
figure(1)
plot((1:size(V,1)), V)
legend(C, 'Location','W')
  4 Comments
Star Strider
Star Strider on 14 Nov 2017
My pleasure.
If my Answer helped you solve your problem, please Accept it!

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!