|
Prev: How do I create a 128*256 sparse matrix for LDPC?
Next: Is it error when use PCA to recognize trained face image. Why?
From: muzaffar on 5 May 2008 10:18 thanks for the email and concern. could you please tell me why i am unable to get values for variable outdd? in the following program. i can get and plot scroll wheel up/down movement with time let say but i am unable to get array values in the end. plz use hold on at command line after calling to the function below. function outdd= scroll_wheel12() % Illustrates how to use WindowScrollWheelFcn property %f = %e 'WindowScrollWheelFcn' global dd set(gcf,'WindowScrollWheelFcn',@figScroll); x = [0:.1:40]; y = 4.*cos(x)./(x+2); a = axes; h = plot(x,y); title('Rotate the scroll wheel') var12=0; tv12=1; function figScroll(src,evnt) if evnt.VerticalScrollCount > 0 var12=var12+1; tt(tv12)=tv12; xv12(tv12)=var12; elseif evnt.VerticalScrollCount < 0 var12=var12-1; tt(tv12)=tv12; xv12(tv12)=var12; end disp('time') disp(tv12) disp('value') disp(var12) %outdd=[tv12 var12]; dd=[tt; xv12]; plot(tt,xv12,'*') tv12=tv12+1; end %figScroll % disp(eventdata.scrdata) disp(var12) % outdd=[tv12 var12]; outdd=dd; end % scroll_wheel roberson(a)ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in message <fvfrk5$1tt$1(a)canopus.cc.umanitoba.ca>... > In article <fvfnpd$rcl$1(a)fred.mathworks.com>, > muzaffar <muzaffarbashir(a)yahoo.com> wrote: > > >could you please give me some more details how i can use it > > >"Use the WindowScrollWheelFcn callback, get the count from > >the ...." > >if i move scroll wheel up and down (at the same time ) is > >it possible to get its values in some variable. > > You can't move the scroll wheel up and down *at the same time*, > unless you are referring to different axes (e.g., that you > mean "rotate counter-clockwise" when you say "up", and > you mean "press vertically to click the middle button" when you say "down".) > > As far as Matlab is concerned, at any instant, the scroll wheel > either stays the same, rotates forward one "click", or rotates > backwards one "click". Matlab increments a counter for each "forward" > (clockwise, "down") click, and decrements a counter for each "backwards" > (counter-clockwise, "up") click, so when the counter is fetched it > represents the net rotation since the counter was last cleared. > > For more information, see the Matlab documentation on Figure Properties, > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/f igure_props.html > > and search about 80% of the way through the page to the description > of WindowScrollWheelFcn > > For more information on creating callbacks, > > http://www.mathworks.com/access/helpdesk/help/techdoc/creat ing_guis/f16-999606.html > -- > "No one has the right to destroy another person's belief by > demanding empirical evidence." -- Ann Landers |