Sketch the graph using matlab

3 ビュー (過去 30 日間)
Ta Duc
Ta Duc 2021 年 7 月 5 日
コメント済み: Ta Duc 2021 年 7 月 5 日
Draw the graph of f and its tangent plane at the given point. (Use your computer algebra system both to compute the partial derivatives and to graph the surface and its tangent plane.) Then zoom in until the surface and the tangent plane become indistinguishable. f(x, y)=[xy sin(x-y)]/[1+x^2+y^2], and the given point(1, 1, 0)
  2 件のコメント
KSSV
KSSV 2021 年 7 月 5 日
What have you attempted?
Ta Duc
Ta Duc 2021 年 7 月 5 日
I’ve just finished my hand-written solving but i’m not good at matlab so i need you to solve the problem by using matlab. Thank u so much🥰

サインインしてコメントする。

採用された回答

Scott MacKenzie
Scott MacKenzie 2021 年 7 月 5 日
編集済み: Scott MacKenzie 2021 年 7 月 5 日
I think this is what you are looking for. NOTE: My script is based on code in Find Tangent Plane to Surface which you should review for further details.
% function domain
x = -3:0.25:3;
y = -3:0.25:3;
% your function
f = @(x,y) (x .* y .* sin(x-y)) ./ (1 + x.^2 + y.^2);
% use gradient to find partial derivatives of f.
[xx, yy] = meshgrid(x,y);
[fx, fy] = gradient(f(xx,yy), 0.25);
% find tangent plane at query point of interest
xq = 1;
yq = 1;
t = (xx == xq) & (yy == yq);
indt = find(t);
fxq = fx(indt);
fyq = fy(indt);
% plot the function over domain
surf(xx,yy,f(xx,yy),'EdgeAlpha',0.7,'FaceAlpha',0.9)
hold on;
xlabel('X'); ylabel('Y'); zlabel('Z');
% tangent plane equation and points
z = @(x,y) f(xq,yq) + fxq*(x-xq) + fyq*(y-yq);
zz = z(xx,yy);
% plot tangent plain and point-of-intersection
surf(xx,yy,zz);
plot3(1,1,f(1,1), 'or', 'markerfacecolor', 'r', 'markersize', 5);
  1 件のコメント
Ta Duc
Ta Duc 2021 年 7 月 5 日
@Scott MacKenzie Thank u so much. I'm very appriciate with your code. <3

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by