plotting functions over domain
조회 수: 70 (최근 30일)
이전 댓글 표시
how would i go about doing this im constanly getting erros with my current code
Plot the function f (x, y) = (x^2 + 3y^2)e^1−x^2-y^2
over the domain −1 ≤ x ≤ 1, −1 ≤ y ≤ 1.
댓글 수: 0
채택된 답변
Matt J
2023년 3월 23일
fsurf(@(x,y) (x.^2 + 3*y.^2).*exp(1 - x.^2 - y.^2), [-1,1],ShowContours='on');
댓글 수: 0
추가 답변 (1개)
the cyclist
2023년 3월 23일
f = @(x,y) (x.^2 + 3*y.^2).*exp(1 - x.^2 - y.^2); % I'm not certain about your notation here
x = -1 : 0.05 : 1;
y = -1 : 0.05 : 1;
[xx,yy] = meshgrid(x,y);
figure
surf(xx,yy,f(xx,yy))
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!