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

  • MATLAB
  • Thread starter lcr2139
  • Start date
  • Tags
    Matlab Mean
In summary, ./ in MATLAB stands for rdivide and is used to divide elements in a vector. It can be used to take the derivative of an experimental plot, integrate it, or subtract two experimental plots from each other.
  • #1
lcr2139
62
1
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
  • #2
Also, how do you integrate it?
 
  • #3
Also, how do you subtract two experimental plots from each other?
 
  • #5
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
 

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

1. What does the "./" notation mean in MATLAB?

The "./" notation in MATLAB is used to denote element-wise operations on arrays. It allows you to perform operations on each element of an array individually, rather than on the entire array at once.

2. How is "./" different from "/" in MATLAB?

The "/" operator in MATLAB performs matrix division, while "./" performs element-wise division. This means that "/" divides the entire matrix by a single value, while "./" divides each element of the matrix by a corresponding value.

3. Can "./" be used with matrices of different sizes?

Yes, "./" can be used with matrices of different sizes as long as the dimensions are compatible. In this case, MATLAB will automatically perform implicit expansion to match the dimensions before performing the element-wise operation.

4. Is "./" specific to MATLAB?

Yes, "./" is a MATLAB-specific notation and is not used in other programming languages. However, some other languages may have similar element-wise operations, such as Python's "numpy.divide" function.

5. How can I use "./" in my MATLAB code?

To use "./" in your MATLAB code, simply include it between two arrays or a scalar and an array. For example, to perform element-wise multiplication on two arrays, you would use the notation "array1 ./ array2".

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
846
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
Back
Top