|
Prev: How to identify a Stateflow with get_param?
Next: hook functions before and after RTW build process
From: muzaffar on 6 May 2008 10:46 hi everybody could some one 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
|
Pages: 1 Prev: How to identify a Stateflow with get_param? Next: hook functions before and after RTW build process |