MATLAB Answers

How do I make surf accurately reflect my data?

2 views (last 30 days)
Henrik
Henrik on 18 Nov 2014
Commented: Henrik on 23 Nov 2014
Consider this example:
A=zeros(5);
A(3,3)=1;
surf(A)
view(2)
When viewing this, one would be tempted to think that there's a peak at (3.5,3.5) and not at (3,3). Is there a way to make surf (or another function) show the right color exactly where the peak is?
Of course I want to implement this for more complicated data sets, so a general solution would be very nice.

Answers (1)

Orion
Orion on 18 Nov 2014
you can play with shading
A=zeros(5);
A(3,3)=1;
surf(A);
pause(1)
view(2);
pause(1)
shading interp
  4 Comments
Henrik
Henrik on 23 Nov 2014
Thank you Mike, this seems to be exactly what I need. If you post this as an answer I'll accept it.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by