MATLAB: How to plot Contour Plot contour plot I have 3 variables data in xls file. I want to plot contour plot of one variable against other 2 variables on x and y axis. How do I do this? Best Answer I assume your variables are vectors. If they are gridded, it is only necessary to use the reshape function to form them into matrices. If they are not gridded, something like this will work: x = rand(20, 1);y = rand(20, 1);z = rand(20, 1);xv = linspace(min(x), max(x), 50);yv = linspace(min(y), max(y), 50);[X,Y] = ndgrid(xv, yv);Z = griddata(x, y, z, X, Y);figurecontourf(X, Y, Z)Experiment to get the result you want. Related SolutionsMATLAB: How to plot two different 3D graphics together The command "figure" creates a new figure. Use just one of them, and run "hold on". MATLAB: How to make mesh plot and contour plot. Z = (2.*X.^2)+(3.*Y.^2)-(4.*X.*Y)-Y-(3.*X); %use the grid versions of x, y rather than the vectors Related QuestionI want to contour plot X,Y coordinate of temperature distribution heat map, the data field is a ring…Having trouble to contour plot the results of a matrix.Contour plot for given x,y,z
Best Answer