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?
0 件のコメント
回答 (1 件)
Javier
2012 年 9 月 14 日
Hello CY
Im going to use the following function (it comes in Matlab help/mesh function).
%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
mesh(Z);
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)
Newz=feval(@(NewR)[sin(NewR)./NewR],NewR)
Hope it helps.
Best regards and if solve your question please grade.
Javier
2 件のコメント
Nathalie
2014 年 3 月 20 日
Hi Javier,
can you please help me with my question: http://www.mathworks.com/matlabcentral/answers/122444-how-to-find-x-for-a-given-value-of-y
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!