Prev: Assigning different values to a variable in every loop
Next: Coordinate transformation - cylindrical to cartesian
From: Robert on 11 Jun 2010 16:30 I'm using Cogent in Matlab for a psychophysics study. I am displaying pictures (jpegs) and would like the picture to either slowly zoom in or slowly zoom out after a participant responds to the picture. Any idea of how to do this? Code is below: loadpict('risk1.jpg', 1); drawpict(1); EX1choice=0; while (EX1choice ==0) reply = readButtonBox(addr+1, 2000) if reply == 2 EX1choice = 2; end if reply == 1 EX1choice = 1; end end
From: Walter Roberson on 11 Jun 2010 17:03
Robert wrote: > I'm using Cogent in Matlab for a psychophysics study. I am displaying > pictures (jpegs) and would like the picture to either slowly zoom in or > slowly zoom out after a participant responds to the picture. Any idea of > how to do this? Code is below: > > loadpict('risk1.jpg', 1); > drawpict(1); > > EX1choice=0; > while (EX1choice ==0) reply = readButtonBox(addr+1, 2000) > if reply == 2 EX1choice = 2; > end > if reply == 1 EX1choice = 1; > end > end To zoom by program, set the axes XLim and YLim parameters to the new box you want to have displayed. The zoom(factor) command should work in theory, but at least in 2008b I could not get it to affect an image . |