Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab graphing problem

  1. Oct 16, 2007 #1
    Im trying to plot a graph with eror bars for two 1d arrays. But for some reason matlab wont let me do it. Can you please help me as quickly as possible as im currectly sitting in a computer lab and am very tired.

    My code is:

    W = 10:10:60;
    V1 = [0.103,0.223,0.351,0.436,0.555,0.664];
    e = (+-0.05);

  2. jcsd
  3. Oct 24, 2007 #2


    User Avatar
    Science Advisor
    Homework Helper

    your problem is with variable 'e', it must be a vector of same length as W and V1. It is okay to specify constants in a vector, but +- is not a valid prefix. Leaving off the +-, the plot will give a symmetric error-bar 2e long.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Matlab graphing problem Date
Matlab Graphing in Matlab Oct 9, 2017
Matlab Matlab Power Fit on Graph-Codes Apr 23, 2017
Problem with graph in Matlab Jul 5, 2012
Matlab graphing/plotting problem Mar 13, 2008
Matlab graphing/plotting problem Mar 13, 2008