3D Contour Plot with 3-independent variables.

3 vues (au cours des 30 derniers jours)
Brandon Fox
Brandon Fox le 21 Oct 2015
Commenté : Stefan Raab le 21 Oct 2015
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 commentaire
Stefan Raab
Stefan Raab le 21 Oct 2015
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);

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by