MATLAB: Converting tabulated data to 3D plot surface 3d plot by tabulated data Hi, I have the attached table. I would be grateful if you can tell me how to show it in 3D ( Red–> x ; Green–> Y & White cells–>Z) Thanks, Ehsan Best Answer Hi,define a vector xx = [0 10 30 60 120 -10];define a vector yy = 1000:1000:7000;and calculate/write your z values in a matrix z = [size(y), size(x)].In this example i use random integers:z = randi(100,length(y),length(x));Then use the surf function:surf(x,y,z)to get a 3D surface plot from your data.Note that this procedure sorts your vector x in ascending order. if you want to avoid this, use:surf(z)and change the values that are used for the labeling of the axes by using your values from x and y.Best regardsStephan Related SolutionsMATLAB: Tabulated Value for g The [G] value appears to be the third value (row) in the ‘f’ vector, and so is the third column in ‘y’. To plot it, try this: figureplot(t, y(:,3))gridIf that gives you the result you want, then you know that ‘y(:,3)’ is [G]. MATLAB: How to plot a constant Z value with varying X and Y [X,Y] = meshgrid(1:50,1:50);Z=3*ones(length(Y),length(X));surf(X,Y,Z);Best wishesTorsten. Related QuestionCross tabulation row percentagesTabulate cell2tableTabulate cell2table
Best Answer