Matlab matrix bar graph with errors

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 5K views
Toni103
Messages
11
Reaction score
0
As in the title I have a MATLAB graph. Its a bar chart with two sets of data done in matrix form. When I try and put in error bars the way I'm used to they both go on but in the middle of the two sets of data. Any way I can make them appear over the actual bars? Any help greatly appreciated!

The code I have so far is:

close all
clear;
clc

Under = [ 5.46, 2.02, 1.17];
Outside = [7.23, 3.99, 3.2];

E = [1.162, 1.162, 1.162];

data = [Under; Outside];

Matrix = (data');

%size (Matrix)

figure (1);
bar(Matrix); hold on
errorbar(Under ,E, 'ks');
errorbar(Outside, E, 'ks');

ylabel('SNR');
xlabel('Layers of tape');
title('Optimised Settings');
 
Physics news on Phys.org