function error2bar(x,ex,y,ey) % plots errorbars with x +/- ex, y +/x ey %(ex and ey are absolute, not %, errors) % all inputs must be row vectors % Charlie Sullivan, 7/99 xe = [1; 1; 1; 1 ; 1; 1]*x+[-1; 1; 0; 0; 1; -1]*ex; ye = [1; 1; 1; 1 ; 1; 1]*y+[-1; -1; -1; 1; 1; 1]*ey; plot(x,y,'og',xe,ye,'-r')