3D Contour Plot with 3-independent variables.

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

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

질문:

2015년 10월 21일

댓글:

2015년 10월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by