フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how I solve this

2 ビュー (過去 30 日間)
Ghulam Murtaza
Ghulam Murtaza 2016 年 6 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hi if i have polynomial like
p1 = x^2+x*y+y^2-2
p2 = x+y+x*y
and set of points like S= {(1,0),(1,-1),(5,7),...,(-1,-8)} , how I solve these polynomial on this set and get complete answer in a easy way. i mean all these polynomial evaluated on each point of set.

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 6 月 22 日
S= {[1,0], [1,-1], [5,7], [-1,-8]}; %not the most natural of representations, but if it is what you have...
xy = cell2mat(S(:));
x = xy(:,1);
y = xy(:,2);
Now rewrite your multinomials to be vectorized:
p1 = x.^2 + x.*y + y.^2 - 2;
p2 = x + y + x.*y;
And you can then graph
pointsize = 20;
scatter3(x, y, p1, pointsize, 'r');
hold on
scatter3(x, y, p2, pointsize, 'b');
hold off

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by