how to plot multi variable function

32 ビュー (過去 30 日間)
uzmeed
uzmeed 2018 年 5 月 18 日
回答済み: Francis Moses Obinna 2022 年 2 月 10 日
How can i plot this multi variable function t=@(x,y)(x^2-2*x-x*y+2*y^2); regards

回答 (2 件)

Ameer Hamza
Ameer Hamza 2018 年 5 月 18 日
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));

Francis Moses Obinna
Francis Moses Obinna 2022 年 2 月 10 日
t = 0:pi/50:10*pi; %% % Calculate sine for each value in t. st = sin(t); %% % Calculate cosine for each value in t. ct = cos(t); %% % Use the 'plot3' function to display a three-dimensional plot of a set of data points. figure; plot3(st, ct, t) xlabel('sin(t)') ylabel('cos(t)')

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by