Display standard deviations and data points on a graph

26 views (last 30 days)
I have calculated the mean and standard deviations. I am attempting to display the mean and standard deviations along the x-axis. I would like to display the datapoints (which are 1 thru 5) along the y axis. My goal is to display the individual datapoints in the graph, showing where they fall around the mean and standard deviations. I am now getting the error: vectors must be the same length. What should I do to get rid of the error and display these approximate 100 datapoints correctly? Please let me know what I'm doing wrong.
x = [0 stdP1w1 meanP1 stdP1sig2];
y = datap1;
plot(x,y)
xticks([0 stdP1w1 meanP1 stdP1sig2])
xticklabels({'0','\sigma', 'mu','2\sigma'})
yticks ([0 1 2 3 4 5])
Error using plot
Vectors must be the same length.

Answers (1)

Manas Meena
Manas Meena on 10 Feb 2021

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!