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

Matlab Plotting Data

  1. Mar 18, 2017 #1
    I have some datas from our physics experimetn and we have to plot them on matlab.Idk how to do them,I dont know how to write codes.Also I have to write of the axises and table names
     
  2. jcsd
  3. Mar 18, 2017 #2

    lewando

    User Avatar
    Gold Member

  4. Mar 18, 2017 #3

    Drakkith

    User Avatar

    Staff: Mentor

    If you have no programming experience and you've never used matlab before then it's very, very difficult to help you without literally writing your code for you.
    Do you have any group members who are familiar with MatLab? If not, then I highly recommend talking to your teacher about this.
     
  5. Mar 18, 2017 #4
    I wrote codesbefore just I lost them and I dont remember...
    thanks seems usefull
     
  6. Mar 18, 2017 #5

    jedishrfu

    Staff: Mentor

    The simplest plotting program is
    Code (Matlab M):

    X=[0:0.1:10];
    Y=X.*X;
    plot(X,Y);
     
    In your case replace x and y values with your data to get your plot.

    From there you can find some Matlab tutorials to help you further or ask here when you've some specific programming problem.
     
  7. Mar 18, 2017 #6

    Drakkith

    User Avatar

    Staff: Mentor

    Note that matlab uses matrices and vectors to store variable values, so some of the operations need a period before them. For example, in jedi's post just above mine, the period just before the asterisk is required since you're doing an element by element operation. In other words:

    ##y=x.*x##
    is not the same thing as:
    ##y=x*x##

    Leaving out the period will give you an error.
     
  8. Mar 18, 2017 #7
    I have 100+ data.I remember some special code for it
     
  9. Mar 18, 2017 #8

    jedishrfu

    Staff: Mentor

    What format is your data?

    Search on google for Matlab code that reads data files.
     
  10. Mar 18, 2017 #9
    In notepad.
     
  11. Mar 18, 2017 #10

    jedishrfu

    Staff: Mentor

    Did you search google for the code?
     
  12. Mar 18, 2017 #11
    I ll look tomorrow in detail.
     
  13. Mar 19, 2017 #12
    I import the data but my graphy looks weird,I dont know why andd btw I have 1100 variable.
     
  14. Mar 19, 2017 #13

    Drakkith

    User Avatar

    Staff: Mentor

    You haven't really given us enough information to be able to help you. We have no idea what kind of graph you want, what kind of data you have, what experiments you've done, etc.
     
  15. Mar 19, 2017 #14
    Ok wait a sec I ll give all data
     
  16. Mar 19, 2017 #15
    We made a electrostatic experiment.Here is the pdf of the experiment.
    Now I plot my data for Part (A). The graph should look like this,(Charge-time thing )
    I have charge,time data.
    And I get this ( in the attachments sections)
    they y axis is charges and the x axis is time.From my data I can see that positive charge is 0,004C and negative should be -0,004C.In the graph its not obvious cause boundries conflict with my data result and graph looks weird and theres also a gap in 11,1-11,5 seconds.The data in that part is in the attachments.

    I hope this helps
     

    Attached Files:

  17. Mar 19, 2017 #16
    I have also a question.First we lowered the white stick and charge data give us positiive value..But the measurement device measures the potentail difference between the pails.So then white pail should be charged negative so can potential difference can be positive ? (First 2 questions )
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted