Calculate 2 and 3 standard deviations
Ältere Kommentare anzeigen
I'm working on calculating 2 and 3 standard deviations to plot on a graph. I'm using the functions mean() and std() for mean and standard deviation calculations. What I'm not understanding is if using std() function provides 1 standard deviation, why use (mean + 2*std()) and (mean + 3*std()) to get the 2 and 3 standard deviations? Would it not be (2*std()) for 2 standard deviations and (3*std()) (that is, without the mean value)? From reading other similar questions/answers here, (mean + 2*std()) and (mean + 3*std()) seems to be correct, but I'm not following why.
2 Kommentare
Sunshine
am 28 Mai 2020
Steven Lord
am 29 Mai 2020
ax.XTick is not a function that sets the ticks. Either assign to that property or use the xticks function.
ax.XTick = [-3*pi -2*pi -pi 0 pi 2*pi 3*pi]; % or
xticks([-3*pi -2*pi -pi 0 pi 2*pi 3*pi]);
Or to simplify things a little:
ax.XTick = pi*(-3:3);
xticks(pi*(-3:3));
If you look at the See Also section at the end of the documentation page for the xticks function you'll see other similar functions that will be of use to you.
doc xticks
Antworten (0)
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!