Matlab Plotting Data

1. Mar 18, 2017

Arman777

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. Mar 18, 2017

lewando

3. Mar 18, 2017

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.

4. Mar 18, 2017

Arman777

I wrote codesbefore just I lost them and I dont remember...
thanks seems usefull

5. Mar 18, 2017

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.

6. Mar 18, 2017

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.

7. Mar 18, 2017

Arman777

I have 100+ data.I remember some special code for it

8. Mar 18, 2017

Staff: Mentor

What format is your data?

Search on google for Matlab code that reads data files.

9. Mar 18, 2017

Arman777

10. Mar 18, 2017

Staff: Mentor

Did you search google for the code?

11. Mar 18, 2017

Arman777

I ll look tomorrow in detail.

12. Mar 19, 2017

Arman777

I import the data but my graphy looks weird,I dont know why andd btw I have 1100 variable.

13. Mar 19, 2017

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.

14. Mar 19, 2017

Arman777

Ok wait a sec I ll give all data

15. Mar 19, 2017

Arman777

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:

File size:
444.2 KB
Views:
119
File size:
49.3 KB
Views:
90
File size:
72.3 KB
Views:
92
• data.png
File size:
172.1 KB
Views:
91
16. Mar 19, 2017

Arman777

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 )