want ideas for contour, z is not a function for x,y

I'm begginer this.
I want draw a gragh using "contour".
I know the way of this is contour(x,y,Z) at help.
here, Z is function for x,y.
is it only this rule?
I want use this with Z is constant.
for example,
x y z
1 .2 10
2 .3 11
3 .4 12
4 .5 13
5 .6 14
as you can see, Z is not a function for x,y, constant.
Can I draw that using contour(or contourc, contourf... series of contour)?
How to ~ plz~

Réponses (2)

Z does not need to be related to x and y. For example,
x = sort(rand(1,10));
y = sort(rand(1,15));
z = rand(15,10);
contour(x, y, z);

1 commentaire

If the problem is that your Z is not a grid, then you need to use griddata() or scatteredinterpolant or triscatteredinterp

Connectez-vous pour commenter.

Thorsten
Thorsten le 7 Oct 2015
Modifié(e) : Thorsten le 7 Oct 2015
Yes. Just use
contour(X,Y,Z)

8 commentaires

I want contour style. isn't anyone?
Sorry, I do not get what you want. Please provide some more details.
Z is function at contour(x,y,z)
If z type is constant, don't use the graph of contour type ?
I denote, use contour code(contour,contourc,contourf ...) with constant Z for drawing contour type graph.
No, Z is a variable that has shape length(y) by length(x). Z is not a function! You can assign arbitrary values to Z, like in my example where I showed how you could use rand().
x = 1 : 5;
y = 0.1 : .1 : .5;
z = [1 2 3 1 3; 4 7 1 4 8; -3 -3 -3 11 2; 0 12 5 5 5; 9 8 7 3 3]; %SEE, a CONSTANT
contour(x, y, z)
There is no requirement that z be calculated at all.
I was wondering if Z is Matrix 1*1. How can I draw it
Saif, are your x and y something larger than 1 x 1? Is your Z intended to be the same for all of the locations? Or do you only have a single point? If you only have a single point then what do you expect the contour plot to look like?
Walter, what if my X, Y and Z matrices are 1x900. Why can't I plot a contour for it?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Contour Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by