Technical discussion about Matlab and issues related to Digital Signal Processing.
Hi!!
I downloaded some code from mathworks.com that puts a marker on vertical marker on a figure
that can be moved horizontally. I would like to modify the code so that it puts a horizontal
marker that can be moved vertically. So far I am able to modify the code to all the horizontal
marker be placed. I have reached a part of the code that I do not understand how to edit. I
have tried to replace h for v.
Original code:
h_text(i) = text(xpos,ymid,label,'color',get(h(i),'color'),'UIContextMenu',cmenu_text,...
'UserData',1,'HorizontalAlignment','Left');
set(h_text(i),'ButtonDownFcn',@DownFcn)
set(h_text(i),'EraseMode','xor')
set(h(i),'UserData',h_text(i))
My edit:
v_text(i) = text(ypos,xmid,label,'color',get(v(i),'color'),'UIContextMenu',cmenu_text,...
'UserData',1,'VerticalAlignment','Bottom');
set(v_text(i),'LeftDownFcn',@DownFcn)
set(v_text(i),'EraseMode','xor')
set(v(i),'UserData',v_text(i))
I reason that I can simply replace 'Left' for 'Bottom' as they are the most negative and
'Right' for 'Top. However I cannot replace 'ButtonDownFcn' for 'TopDownFcn' and I have
established that the problem lies here by stepping through both codes (the original and my
edition) one line at a time. Please help. In case the original program is called data_marker.m
and is available on mathworks website.
Thanks in advance
Duro