How do I create a 3 dimensional response surface plot from X Y Z points ?

38 ビュー (過去 30 日間)
ferdi bayram
ferdi bayram 2019 年 11 月 17 日
コメント済み: ferdi bayram 2019 年 11 月 18 日
Hi all,
I am struggling a bit here, and hope somebody could help. I have a set of X Y and Z points and Z is not found by any function of X and Y. In other words, I have independent X Y and Z values and these values are;
X Y Z
288 2.79 7.55
318 4.64 14.28
127 2.31 8.31
132 7.16 17.27
264 2.31 4.32
200 2.60 6.74
268 3.06 15.12
I need to create a response surface plot (contour plot) from these values. I would be so glad and thankful if somebody could help with with that. I am sorry if question is not very clear. If not, I can ask in detail. In sort, I have eight X Y Z independent data and want to create a response surface.
Best Regards,
Ferdi
  3 件のコメント
ferdi bayram
ferdi bayram 2019 年 11 月 18 日
Hi Shubham,
First of all, thank you for trying to help me. Let me upload a couple of figures to clarify what I want. Since I do not know matlab deeply, I am not sure whether it is something I would be done
ferdi bayram
ferdi bayram 2019 年 11 月 18 日
Here is what exactl what I want and I have done t in minitab program. The problem in here is that there is no scale bar and it is not colorful (red blue yellow to show critical points). That is why I am trying to solve this problem via matlab

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

採用された回答

Akira Agata
Akira Agata 2019 年 11 月 18 日
How about using an interpolation? The following is a simple example:
% Apply cubic interpolation
[xGrid,yGrid] = meshgrid(linspace(min(X),max(X)),linspace(min(Y),max(Y)));
zGrid = griddata(X(:),Y(:),Z(:),xGrid(:),yGrid(:),'cubic');
zGrid = reshape(zGrid,size(xGrid));
% Visualize the result
figure
contour(xGrid,yGrid,zGrid,'ShowText','on')
hold on
scatter(X,Y,'ro')
grid on
colorbar
contour.png
  5 件のコメント
Akira Agata
Akira Agata 2019 年 11 月 18 日
Please try the following:
D = [288 2.79 7.55;
318 4.64 14.28;
127 2.31 8.31;
132 7.16 17.27;
264 2.31 4.32;
200 2.60 6.74;
268 3.06 15.12];
X = D(:,1);
Y = D(:,2);
Z = D(:,3);
% Create 100x100 grid mesh (x,y) points
[xGrid,yGrid] = meshgrid(linspace(min(X),max(X)),linspace(min(Y),max(Y)));
% Interpolation
zGrid = griddata(X(:),Y(:),Z(:),xGrid(:),yGrid(:),'cubic');
zGrid = reshape(zGrid,size(xGrid));
% Fig.1 Contour plot with original data points
figure
contour(xGrid,yGrid,zGrid,'ShowText','on')
hold on
scatter(X,Y,'ro')
grid on
colorbar
% Fig.2 Surf plot
figure
surf(xGrid,yGrid,zGrid)
colormap(jet)
colorbar
ferdi bayram
ferdi bayram 2019 年 11 月 18 日
Thank you very much Akira, it worked :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by