Difference between revisions of "Fdvec.m"

From Spinach Documentation Wiki
Jump to: navigation, search
Line 1: Line 1:
−
{{DISPLAYTITLE:fdvec.m}}
+
{{DISPLAYTITLE:function.m}}
−
Calculates finite difference weights for numerical derivatives, including order 0, which amounts to interpolation.
+
Reasonable description of what the function does and how.
  
 
==Syntax==
 
==Syntax==
  
−
      w=fdweights(target_point,grid_points,max_order)
+
    function call string
  
 
==Arguments==
 
==Arguments==
  
−
     target_point - the point at which the derivative
+
     argument      - description of the argument
−
                    is required
+
 
−
+
     argument      - description of the argument
−
     grid_points  - the points at which the function
+
                    description of the argument
−
                    is given
 
−
 
−
    max_order    - maximum derivative order
 
  
 
==Outputs==
 
==Outputs==
  
−
     w            - finite difference coefficient array
+
     output  - description of the output
−
                    with the coefficients for the succes-
+
−
                    sive derivatives in rows
+
    output  - description of the output
 +
              description of the output
  
 
==Examples==
 
==Examples==
−
Point weights for central schemes on a three-point stencil, where the value is required at the centre:
+
A description of what is done in the example below:
  
−
  >> fdweights(0,[-1 0 1],2)
+
    % Comment
 +
    matlab code
 
   
 
   
−
  ans =
+
    % Comment
−
 
+
     matlab code
−
          0    1.0000        0
 
−
     -0.5000        0    0.5000
 
−
      1.0000  -2.0000    1.0000
 
  
−
The three rows are for interpolation, first derivative and second derivative respectively.
+
==Notes==
 +
Reasonable further notes on good and bad practices.
  
 
==See also==
 
==See also==
−
[[fdmat.m]], [[fdlap.m]], [[fdhess.m]], [[fdkup.m]], [[fdweights.m]], [[fftdiff.m]], [[fourdif.m]], [[fourlap.m]]
+
Links to related functions.
  
  
−
''Version 2.2, authors: Bengt Fornberg, [[Ilya Kuprov]]''
+
''Version 2.2, authors: [[Author 1]]''

Revision as of 15:04, 16 August 2018

Reasonable description of what the function does and how.

Syntax

    function call string

Arguments

    argument      - description of the argument
    argument      - description of the argument
                    description of the argument

Outputs

    output  - description of the output

    output  - description of the output
              description of the output

Examples

A description of what is done in the example below:

    % Comment
    matlab code

    % Comment
    matlab code

Notes

Reasonable further notes on good and bad practices.

See also

Links to related functions.


Version 2.2, authors: Author 1