ploting error bars of matrix
Show older comments
i have a matrix A of 300*2 first colum is a time stamp and secornd colum is measurement. I have calculated the error of associated with measurement and named it error_data how can i plot the graph of matrix A with errorbars i.e the error_data. I am a rookie in matlab at the moment
Answers (1)
Star Strider
on 24 Jan 2016
Here is one approach:
M = [1:20; rand(1,20)]';
fun = @(M) [M(:,1) M(:,2) M(:,2)*sqrt(5E-11)];
R = fun(M);
figure(1)
errorbar(R(:,1), R(:,2), R(:,3)) % ‘Regular’ Error Bar Plot
grid
figure(2)
plot(R(:,1), R(:,2), '-b') % Plot Blue Line Data
hold on
errorbar(R(:,1), R(:,2), R(:,3), '.r') % Plot Red Error Bars
hold off
grid
Categories
Find more on Annotations 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!