MATLAB How can I use MATLAB to take the derivative of an experimental plot?

  • Thread starter Thread starter lcr2139
  • Start date Start date
  • Tags Tags
    Matlab Mean
AI Thread Summary
In MATLAB, the operator "./" represents element-wise division, allowing for the division of corresponding elements in two arrays or vectors. For example, using "x = [1:10]" and "y = [1:0.5:5]", the expression "x ./ y" divides each element of x by the corresponding element of y. To take the derivative of an experimental plot in MATLAB, the "diff" function can be used to compute the differences between consecutive data points, which can then be divided by the differences in the x-values to approximate the derivative. For integration, the "trapz" function is commonly used for numerical integration of data points. To subtract two experimental plots, the same element-wise division operator "./" can be applied, allowing for the subtraction of corresponding elements in two datasets.
lcr2139
Messages
58
Reaction score
0
In MATLAB, what does ./ mean?

Also, I would like to take the derivative of an experimental plot. How do I do so?
 
Physics news on Phys.org
Also, how do you integrate it?
 
Also, how do you subtract two experimental plots from each other?
 
Its used to pair elements of a vector together to divide them.

As an example, try this:
Matlab:
x = [ 1 : 10 ]
y = [ 1 : 0.5  : 5 ]
x ./ y
It divides each element of x by an element of y

or this
Matlab:
x = [ 0  : 0.1 : 10 ]
y = x .* x
plot( x , y )
squares each element of x and plots a parabola x vs y chart
 

Similar threads

Replies
1
Views
2K
Replies
8
Views
2K
Replies
5
Views
2K
Replies
5
Views
3K
Replies
32
Views
4K
Replies
4
Views
2K
Replies
1
Views
5K
Back
Top