How can I change the color of a mesh at specific indices?

조회 수: 4 (최근 30일)
Will Forfang
Will Forfang 2013년 3월 2일
I have a mesh plotted in a GUI via the following command:
handles.mesh = mesh(X,Y,Z,'facecolor','b',... etc.
I've plotted it in 3d purely for aesthetics; the raw data is 2-dimensional. I then periodically update the plot's values by virtue of a timer, and the set command, shown here:
set(handles.mesh,'ZData',PSD2);
This is what the mesh looks like (ignore that floating label):
What I would like to do now is highlight (change the color of) specific peaks that are of interest to me. If I have a vector that contains the index of the peaks that I'm interested in, is there a way I can use that vector to color the mesh just near those indices?
I.e. -- if I want the peak that is (currently) at 4000 Hz to be red, while the others remain yellow, can I do this?
Thanks,
-Will

채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 2일
Yes. See the CData property here

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by