Display standard deviations and data points on a graph

26 ビュー (過去 30 日間)
Sunshine
Sunshine 2020 年 5 月 29 日
回答済み: Manas Meena 2021 年 2 月 10 日
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.

回答 (1 件)

Manas Meena
Manas Meena 2021 年 2 月 10 日

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by