Filter löschen
Filter löschen

Function of two variable for specific values of Z?

1 Ansicht (letzte 30 Tage)
amine&&
amine&& am 5 Jul. 2016
Kommentiert: amine&& am 6 Jul. 2016
I want to draw my function of two variable so that the graph gives me Z values between -5 and 5. I used this code but it gives me the values of Z from 0 :
[X,Y] = meshgrid(0:.2:1, 0:.2:1);
Z = arrayfun(@mFunction, X, Y);
surf(X,Y,Z)
How I should proceed. Thanks!
  2 Kommentare
Star Strider
Star Strider am 6 Jul. 2016
Without knowing what ‘mFunction’ is, no Answer to your Question is possible.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

James Tursa
James Tursa am 5 Jul. 2016
Maybe define X and Y before you use them?
[X,Y] = meshgrid(0:.2:1, 0:.2:1);
Z = arrayfun(@mFunction, X, Y);
surf(X,Y,Z)
  7 Kommentare
James Tursa
James Tursa am 6 Jul. 2016
Ah ... confusion in the wording. I (and probably other readers) assumed by these words " ...Z values between -5 and 5 ..." that you were actually talking about the Z values being plotted, not the Z axis limits.
amine&&
amine&& am 6 Jul. 2016
You are right James!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by