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

plot 2d

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.

Best Answer

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')