how to plot the function
4 ビュー (過去 30 日間)
古いコメントを表示
f=0.18x+0.003xy+10
in x y plane
採用された回答
Sam Chak
2022 年 7 月 8 日
Follow me, type this out using this example.
Then, you put your equation that you want to plot on the x–y plane.
x = linspace(-60, 60, 1201);
y = -(20*(500 + 9*x))./(3*x);
plot(x, y)
ylim([-6000 6000]), xlabel('x'), ylabel('y')
0 件のコメント
その他の回答 (1 件)
Abderrahim. B
2022 年 7 月 8 日
編集済み: Abderrahim. B
2022 年 7 月 8 日
Try this:
clear
close all
N = 10 ;
x = -N:0.5:N;
y = x;
[X, Y] = meshgrid(x, y);
f = @(x,y)(0.18*x + 0.003*x.*y + 10) ; % Create function
% Using countouf (x y plane)
tiledlayout(2,1)
nexttile
contourf(X, Y, f(X,Y));
% Using surf (3D) plot)
nexttile
surf(X, Y, f(X,Y))
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



