An example of the output would be something like this: I want to plot this in Matlab but in a way to get some kind of density plot with different price levels corresponding to different colors. P(i,j) contains the price of occupying position i at time j. I have a matrix P of m rows and n columns.I trying to get a 3D plot of my Objective.Now, starting with this matrix, an example of a replacement would be: r 3-2r 2 r 3.Element-by-element, row 3, is replaced by the. Contour lines are selected by MATLAB automatically. The x & y coordinates in the plane are column and row indices of Z.
contour3 (Z): Z is a matrix and this function will create a 3-D contour plot which will have the isolines of matrix z will have the height details of x and y plane.
Matlab plotting colors The following are the letters you can add to your code to control the color of your plot while plotting in Matlab. using color to color-code the 4-th dimension, bar size to size-code it, or even vertical stacking). This would amount to plotting a 4D diagram (e.g.