3D Contour Plot with 3-independent variables.

3 次查看(过去 30 天)
I have a 3 Factor, 2 Level Experiment. I am trying to plot my regression model vs. Each Factor. I want X-axis to be my first Factor, Y-axis to be my second factor, and z-axis to be my third Factor. Then my regression model will be indicated by color. Is this possible? I know I can set one of my variables to it's average and plot with 2 factors and my output regression model, however I have to do this for three times, and It would be nice to have one 3d contour plot with all 3 independent variables.
  1 个评论
Stefan Raab
Stefan Raab 2015-10-21
If you have a vector x (nx1) for your factor 1 and a vector y (mx1) for your factor 2 you can use the function [X,Y] = meshgrid(x,y); which will return a matrix X of dimension mxn (x-vector repeated m times) and a matrix Y of dimension mxn (y-vector repeated n times). You will also need a mxn matrix Z for your 3rd factor, where z11 is the value for x1 and y1, z12 is the value for x2 and y1, z1n is the value for xn and y1 and so on. Then you can plot the surface with the function surf(X,Y,Z);

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by