Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
multi dimensional contour plotting

Subject: multi dimensional contour plotting

From: gurbir

Date: 19 Nov, 2008 19:11:02

Message: 1 of 2

Hi everyone,
I've searched around on google and matlab forums, but i haven't found an adequate solution to my situation.

I am exploring phase space of 3 parameters (A, B, C) in a non linear model, and tracking a response variable (N).

I set A=some value,
then scan the plausible ranges for B & C and create a contourf plot.

I've done this over a range of plausible values for parameter A, but i'd like to put everything into 1 figure.

I was thinking B and C could be on the X and Y axes, and A could be on the Z axis. Then for levels of Z i could insert the aforementioned contourf plots.

Any input would help!
Thanks in advance,

Subject: multi dimensional contour plotting

From: Thomas Clark

Date: 20 Nov, 2008 17:08:01

Message: 2 of 2


What you're looking for is an isosurface.

Check out the isosurface commands built into matlab - I'd recommend (certainly to start with) putting A,B and C on the X, Y, and Z axes. then, plot isosurfaces of your response data at different values - after a while, you'll become familiar with what isosurfaces are best.

If you're ultra-keen, you could plot multiple isosurfaces at the same time, and set them to be semi-transparent so you can compare!

1. Use meshgrid or ndgrid to generate 3D coordinates arrays (X,Y,Z).

2. Generate an array R (same size as X,Y and Z) containing the value of the response at this combination of X,Y and Z. e.g. R(1,1,1) = response_function(X(1,1,1), Y(1,1,1), Z(1,1,1));

3. You can achieve (2) either by evaluating the response at each combination of x,y,z (could be slow, depending on the response function) or by determining the response at various scattered X,Y,Z coordinates then using griddatan to interpolate the scattered data to a regular grid.

Hope this helps!

Tom C

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us