How to find value of z from the mesh/surface plot when values of x and y are given?
조회 수: 3 (최근 30일)
Through matlab i use finite-difference method to solve standard dispersal equation with initial condition and boundary condition. A mesh/surface plot is then produced. Now, from the mesh/surface plot, how to find the value of z when values of x and y are given?
Javier 2012년 9월 14일
Im going to use the following function (it comes in Matlab help/mesh function).
[X,Y] = meshgrid(-8:.5:8); %Arbitrary values
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin®./R; %Z is function of X and Y
If you want to find the value of Z at X=5 and Y=4, just evalueta the function Z in that point. This mean that you have to evaluate first in R to get the Z desired result (also work for vectors).
NewR=feval(@(xx,yy)[sqrt(xx.^2 + yy.^2)],5,4)
Hope it helps.
Best regards and if solve your question please grade.