I have a single value matrix that I want to build as a surface. When I try to use the surf function in MATLAB, I get an error indicating that I need to use uint8 or double instead:
x=peaks; %
Now I will try the singles:
x=single(peaks); surf(x);
Gives the following error:
Warning: CData must be double or uint8. Warning: CData must be double or uint8.
Well, this is unfortunate. I think I will have to double the precision for the color map:
x=single(peaks); surf(x,double(x));
It works well. But just for beats, also try uint8:
x=single(peaks); surf(x,uint8(x));
The following are allowed:
Warning: CData must be double or single unless it is used only as a texture data Warning: CData must be double or single unless it is used only as a texture data
What the hell MATLAB? Make up your mind! So, why should I use additional double precision memory to indicate the color scheme for the surf function? Even when the MATLAB error text tells me that I can use uint8 or single, depending on which I did not use ?
source share