File Exchange

image thumbnail

fieldlines

version 1.0 (2.18 KB) by

Plots a field line with the initial point P(x0,y0) for a 2D-field.

2 Downloads

Updated

View License

Plots a field line with the initial point P(x0,y0) for a 2D-field given by an equaly spaced grid of positions and corresponding field components. The function employs the 4th order Runge-Kutta method.

Example:
    [x,y] = meshgrid(-2:.2:2,-1:.15:1);
    z = x .* exp(-x.^2 - y.^2);
    [px,py] = gradient(z,.2,.15);
    quiver(x,y,px,py), axis image,
    hold on
    fieldlines(x,y,px,py,-0.7,0.2)

Comments and Ratings (2)

Victor Noname

it doesn't plot field lines, it plots field vectors.

N/A N/A

MATLAB Release
MATLAB 5.3 (R11)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video