Skip to Main Content Skip to Search
Product Documentation

plot::VectorField3d3D vector field

plot::VectorField3d([v_1, v_2, v_3], x = `x_{min}`..`x_{max}`, y = `y_{min}`..`y_{max}`, z = `z_{min}`..`z_{max}`) represents a plot of the vector field defined by

(x, y, z) -> (v[1](x, y, z), v[2](x, y, z), v[3](x, y, z))

with (x, y, z) in [x_min, x_max] x [y_min, y_max] x [z_min, z_max].

→ Examples

Calls:

plot::VectorField3d([v1, v2, v3], x = `x_{min}` .. `x_{max}`, y = `y_{min}` .. `y_{max}`, z = `z_{min}` .. `z_{max}`, <a = amin .. amax>, Options)

plot::VectorField3d(v1, v2, v3, x = `x_{min}` .. `x_{max}`, y = `y_{min}` .. `y_{max}`, z = `z_{min}` .. `z_{max}`, <a = amin .. amax>, Options)

Parameters:

v1, v2, v3

the x-, y-, and z-component of the vector field: arithmetical expressions in x, y, z and, possibly, the animation parameter a
v1, v2, v3 are equivalent to the attributes XFunction, YFunction, ZFunction.

x, y, z

identifiers.
x, y, z are equivalent to the attributes XName, YName, ZName.

`x_{min}` .. `x_{max}`, `y_{min}` .. `y_{max}`, `z_{min}` .. `z_{max}`

real numerical values.
`x_{min}` .. `x_{max}`, `y_{min}` .. `y_{max}`, `z_{min}` .. `z_{max}` are equivalent to the attributes XRange, YRange, ZRange, XMin, XMax, YMin, YMax, ZMin, ZMax.

See Also:

plot, plot::copy, plot::Ode2d, plot::Ode3d, plot::VectorField2d

Details:

Example 1

We demonstrate a plot of the vector field v(x, y, z) = (1, sin(x) + cos(y), sin(z)):

field := plot::VectorField3d([1, sin(x) + cos(y), sin(z)],
                             x = 0..6, y = 0..2.5, z = 0..5,
                             Mesh = [7, 7, 7]):
plot(field):

MuPAD graphics

delete field:

Example 2

Like most other objects, plot::VectorField3d can be animated by supplying an extra parameter:

mycolor := (x, y, z, vx, vy, vz, a) -> [a, a*z, 1 - a]:
field := plot::VectorField3d([ a*y + (1-a)*x ,
                              -a*x + (1-a)*y,
                               a*sin(PI*z)],
                             x = -1..1, y = -1..1, z = 0..1,
                             LineColorFunction = mycolor,
                             Mesh = [7, 7, 7], a = 0..1):
text := plot::Text3d(a -> "a = ".stringlib::formatf(a, 2, 5),
                     [1, 0.7, 1.2], a = 0..1):
plot(field, text, Axes = Frame)

MuPAD graphicsimage

delete field, text:

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS