+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 5
    Points: 3,620, Level: 14

    Join Date
    Aug 2004
    Posts
    91
    Helped
    24 / 24
    Points
    3,620
    Level
    14

    matlab derivative of data

    Hello:

    I need to compute derivatives of complex discrete data in Matlab, anyone here can tell me how to perform it? (Build-in functions?)

    For example, I have the following frequency dependent data:

    f X
    f1 x1-jy1
    f2 x2+jy2
    f3 x3-jy3
    ...
    ....

    Where fi,xi and yi are real numbers with particular value. How should I compute

    f*dx/df in matlab?

    Thanks in advance.

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 3
    Points: 5,272, Level: 17

    Join Date
    Jun 2002
    Location
    India
    Posts
    840
    Helped
    43 / 43
    Points
    5,272
    Level
    17

    matlab discrete derivative

    Hi,

    cant you use diff instruction and then use array multiplication?

    brmadhukar



    •   AltAdvertisement

        
       

  3. #3
    Member level 5
    Points: 3,620, Level: 14

    Join Date
    Aug 2004
    Posts
    91
    Helped
    24 / 24
    Points
    3,620
    Level
    14

    discrete derivative matlab

    Hello, brmadhukar:

    Thank you for your reply.

    The function diff() in matlab can only operate on real number arrary. Initially I had thought that the we cannot deal with complex number the same way we with the real number, thus posted the help here.

    Later, I searched some materials on this topic and found that as long as one of the variable is real(here in my case is frequency:f), the finite difference that apply to real numbers still can apply to complex number(effectively treat real part and imaginary part of the complex number separately).

    Thus, I can approximate dX/df=diff(X)./diff(f) assuming X is complex discrete data and the result will have a array length of (n-1), assuming the original array X has a length of n.

    Regards,



--[[ ]]--