move a window from top to bottom
2 次查看(过去 30 天)
显示 更早的评论
hai
any one please tell me how to make window of size 100 pixels centered at a particular location to move from top to bottom over a image
thanks in advance
4 个评论
Jan
2011-10-4
@Ramya: It is not getting clearer. Although you know exactly what "projecting some feature and obtain a graph" means, we cannot have the faintest idea of what you are talking about. Neither "projecting", nor "feature", nor "graph" are unequivocal terms in the field of mathematics and computer science. The same problem concerns "window" - do you want a rectangle drawn inside the AXES, a FIGURE window or do you want to perfom some calculation on rectangular parts of the data? What is the "location 600"? Pixels relative to the screen or to the figure, or the Y- or X-value of the data?
回答(2 个)
Walter Roberson
2011-9-15
If the window must move in a particular direction, top to bottom or bottom to top, then you will need to use a "for" loop or one of the compact equivalents (such as arrayfun())
If it does not matter which direction the window moves as long as everything gets covered, then see blockproc(), or blkproc() if you have an older version of MATLAB.
0 个评论
Walter Roberson
2011-10-4
Use rectangle() or patch() to create the window. Use a loop and set() and drawnow() to change the position of the window in a regular way and have the new position updated on the screen.
For example, if you created a patch, you could set() the YData property of the patch to change its vertical position.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!