MATLAB Answers

how to plot multi variable function

182 views (last 30 days)
uzmeed
uzmeed on 18 May 2018
Answered: Ameer Hamza on 18 May 2018
How can i plot this multi variable function t=@(x,y)(x^2-2*x-x*y+2*y^2); regards

  0 Comments

Sign in to comment.

Answers (1)

Ameer Hamza
Ameer Hamza on 18 May 2018
You will get a surface or a contour in this case. For example,
t=@(x,y)(x.^2-2*x-x.*y+2*y.^2);
x = -10:0.1:10; % define range and mesh of x and y which will be shown in figure
y = -10:0.1:10;
[X, Y] = meshgrid(x, y);
surf(X, Y, t(X,Y));
figure;
contourf(X, Y, t(X,Y));

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags