필터 지우기
필터 지우기

Function of two variable for specific values of Z?

조회 수: 1 (최근 30일)
amine&&
amine&& 2016년 7월 5일
댓글: amine&& 2016년 7월 6일
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
Star Strider
Star Strider 2016년 7월 6일
Without knowing what ‘mFunction’ is, no Answer to your Question is possible.

댓글을 달려면 로그인하십시오.

답변 (1개)

James Tursa
James Tursa 2016년 7월 5일
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
James Tursa
James Tursa 2016년 7월 6일
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&& 2016년 7월 6일
You are right James!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by