Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to add Greek letter to data cursor in Matlab figure?
  2. function output_txt = myfunction(obj,event_obj)
  3. % Display the position of the data cursor
  4. % obj          Currently not used (empty)
  5. % event_obj    Handle to event object
  6. % output_txt   Data cursor text string (string or cell array of strings).
  7.  
  8. pos = get(event_obj,'Position');
  9. output_txt = {['X: ',num2str(pos(1),4)],...
  10.     ['Y: ',num2str(pos(2),4)]};
  11. % If there is a Z-coordinate in the position, display it as well
  12. if length(pos) > 2
  13.     output_txt{end+1} = ['Z: ',num2str(pos(3),4)];
  14. end