f=0.18x+0.003xy+10
in x y plane

2 件のコメント

Satyajit Kumar
Satyajit Kumar 2022 年 7 月 8 日
0.18x+0.003xy+10=0 If this has to be plotted in x y plane then
How can we do ,?
Torsten
Torsten 2022 年 7 月 8 日
fimplicit(@(x,y)0.18*x + 0.003*x.*y+10,[-1000 1000 -1000 1000])

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

 採用された回答

Sam Chak
Sam Chak 2022 年 7 月 8 日

1 投票

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')

その他の回答 (1 件)

Abderrahim. B
Abderrahim. B 2022 年 7 月 8 日
編集済み: Abderrahim. B 2022 年 7 月 8 日

1 投票

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))

11 件のコメント

John D'Errico
John D'Errico 2022 年 7 月 8 日
Please don't do obvious homework assignments for students who have made no effort to do them. This teaches the student nothing, except that there will be someone who they can con into doing their homework for them. It hurts the site, because then the same student will then assume it is proper to post their homework, and then they often try to delete their question, once they realize their instructor would not wish them to be posting their homework assignments.
Sam Chak
Sam Chak 2022 年 7 月 8 日
編集済み: Sam Chak 2022 年 7 月 8 日
Just wondering, how did you get two Level badges? Looks cool though... 😎
Satyajit Kumar
Satyajit Kumar 2022 年 7 月 8 日
0.18x+0.003xy+10=0
If this has to be plotted in x y plane then
How can we do ,?
Abderrahim. B
Abderrahim. B 2022 年 7 月 8 日
編集済み: Abderrahim. B 2022 年 7 月 8 日
@John D'Errico thanks. Will try to not answer this kind of questions.
Abderrahim. B
Abderrahim. B 2022 年 7 月 8 日
@Sam Chak have just known that I have 2 level badge, thanks for that. I am here to help . By the way your answer is not correct.
Torsten
Torsten 2022 年 7 月 8 日
By the way: Yours is also wrong.
f = @(x,y)(0.18*x + 0.003*x.*y + 10) ; % Create function
instead of
f = @(x,y)(0.18*x + 0.003*x*y + 10) ; % Create function
Abderrahim. B
Abderrahim. B 2022 年 7 月 8 日
@Torsten yes, elementwise multiplication, was a typo. Thanks
Sam Chak
Sam Chak 2022 年 7 月 8 日
Thanks for pointing out. My original intent was to simply show @Satyajit Kumar how to plot a certain equation like this,
on the plane. Nothing more, nothing less. If fact, I even encouraged him to replace my example with the equation that he wants to plot. If you edit your Answer to fix the small issue on the code as highlighted @Torsten, I will persuade @Satyajit Kumar to accept your Answer. No worries, this is a very small issue.
Have a nice weekend.
Abderrahim. B
Abderrahim. B 2022 年 7 月 8 日
編集済み: Abderrahim. B 2022 年 7 月 8 日
@Sam Chak got your point. In this case your answer is also correct. The small issue was just a typo and I edited my answer already. Enjoy your weekend.
Satyajit Kumar
Satyajit Kumar 2022 年 7 月 9 日
To all , don't create fuss of assignment and all , Always Somewhere is starting to learn something ! so as I am ! I am trying to understand things that's all
Torsten
Torsten 2022 年 7 月 9 日
編集済み: Torsten 2022 年 7 月 9 日
Learning MATLAB primarily means trying and testing. That's what we miss in your attempts to understand the language.

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

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2022 年 7 月 8 日

編集済み:

2022 年 7 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by