MATLAB: 3 dim plot, how to specify color for each point
3-d plotcolor
Hello,
Suppose I want to plot 3-d sin(x+y), x = [0, pi], y = [0, pi]. I have a 3*n matrix to denote the RGB for each point. How to efficiently generate the plot?
Thanks,
Weizhou
Best Answer
x = linspace(0,pi);
y = x;
z = sin(x+y);
col = jet(numel(x)); % sample color from jet colormap
Best Answer