MATLAB: Plot curve with error bars MATLABmatlab error bars standard deviation I have two vectors,how can i calculate the standard deviation for each element so i can plot the error bars in the curve. thank you Best Answer One approach:x = 1:10; % Create Data (Independent Variable)V1 = randn(1, 10); % Create Data (Row Vectors)V2 = randn(1, 10);V12_sd = std([V1; V2]); % Standard DeviationV12_mean = mean([V1; V2]); % Meanfigure(1)errorbar(x, V12_mean, V12_sd)grid Related SolutionsMATLAB: Standard deviation: error because variable is of type double Hi Anna,you can use std2(matrix) mean2(matrix)functions instead.your code did work for me,v = randn(30,15)*sd + M;minimum = min(min(v));maximum = max(max(v));v = (v-minimum)/maximum;Mean = mean(mean(v)); v = reshape(v,30*15, 1);standard_deviation = std(v);and that's it. good luck! MATLAB: Uniform distribution command for specific mean and standard deviation (mean-sqrt(12)/2*s.d.) + sqrt(12)*s.d.*rand(N,1)is uniformly distributed on [a:b] = [m-sqrt(12)/2*s.d.:m+sqrt(12)/2*s.d.] with the prescribed mean and standard deviation. Related QuestionMultiple bar plots and error barsHow to define an arbitrary constant for equationsSolving 8-equations system in 8 variables with lsqnonlin()
Best Answer