From: Sunny on
Hi all,
I'm putting together a GUI that will take out an instance of data of Gait trials, and represent them in slices. I'm doing this by incorporating a graph with a scroll bar.

I can get it to "work", but the problem is that the scroll bar runs by itself from 1 to the total number of gait cycles.

Ideally, I want to be able to push right on the scroll bar, and have each click return a value of 1, which i can add to a dynamic variable.

Anyway, my attempt at this is shown below. Any help would be greatly appreciated.


gait_size = interv2_num - interv1_num;
matsize = size(datavar.data);
rows = matsize(1,1); %change this later
sliderval = floor(rows/gait_size);


set(handles.slider2,'Min',1);
set(handles.slider2,'Max',sliderval);


gait = 0;
while (gait < sliderval)
gait = 1+gait;
start = (gait)*gait_size;
%disp(start:(start+gait_size))
ret = datavar.data(start:(start + gait_size - 1),:);
set(handles.slider2,'Value',gait);
axes(handles.axes2)
plot(ret(:,2:end));
end
From: ImageAnalyst on
Then don't have a loop from 1 to the slider value. Just set gait
equal to the slider value and do it once.