MATLAB: How to plot 4D contourf for the matrix C(40*40) with respect to A(40*40) as x axis and B(40*40) as y axis for different levels z=1000, 800, 600, 400 in one plot

4 dimensioncontourmatrix

Dear Sir I have three matrices A,B and C having same size 40*40. I want to plot a contour of C(40*40) taking A(40*40) as x axis and B(40*40) as y axis for different levels z=1000, 800, 600, 400 in one plot. Please help.

Best Answer

If your X and Y data are sorted in a good grid, then
contourf(X, Y, C, [400, 600, 800, 1000])
If your X and Y are not sortable to a good grid then you will need to do some grid interpolation and contour that.