how to plot three dimensional vector in matlab

how to plot a gradient vector which is function of x, y, z, i.e. grad(f(x,y,z)). i need three dimensional plot of this function, where x,y,z are variables. still i unable to plot this function. my function is given by x-component=x.y y-component=x.^2+y.^2 z-component=(z.^2).x.^2+y for any value of x,y,z how this function will look in three dimensional line or surface plot.

Answers (1)

gradient plots have two values per location, one for the x gradient and one for the y gradient. How do you wish to display the two values simultaneously? For example, are you looking for something like quiver() ?
When you have a function of 3 variables, then you need at least 4 dimensions to represent the output. You can attempt to show the 4th dimension by using color, or by using transparency, or by using dot (sphere) size, or by doing an animation. None of those methods is really satisfying.
You can also use isosurface plots.

1 Comment

still i unable to plot this function. my function is given by
x-component=x.y ;
y-component=x.^2+y.^2 ;
z-component=(z.^2).x.^2+y
for any value of x,y,z how this function will look in three dimensional line or surface plot.how it will propagates in space.please help me

Sign in to comment.

Tags

Asked:

on 14 Jan 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!