如何用matlab实现计算机图形放大??

来源:百度知道 编辑:UC知道 时间:2024/05/17 12:16:34
怎么样更有效的减小失真!!!!!谢谢!!

图形放大及缩小

--------------------------------------------------------------------------------

zoom 指令可以将图形放大或缩小,若要将图形放大时用 zoom on,zoom out,当不再须要放大或缩小图形时用 zoom off。

>> M=peaks(25); % peaks 是MATLAB内建的一个像山峰的特别函数,25是这个

>> plot(M) % 函数矩阵的大小,如果数值愈大则画出的山峰图愈平滑

>> zoom on % 开始放大图形,每按一次Enter键图形就放大一次

>> zoom out % 开始缩小图形,每按一次Enter键图形就缩小一次

>> zoom off % 停止图形放大或缩小功能

可以使用函数来实现此功能

图形移动,放大缩小等功能的函数 :

function axdrag(action)
%AXDRAG Pan and zoom with simple keystrokes
% Use this tool to move quickly around the data displayed in a 2-D plot.
% Make sure the figure has focus, and then press any of the following
% keys to zoom in or out. Clicking and dragging will pan the data.
%
% Keys you can use are:
% z, Z: zoom in, zoom out, in both dimensions
% x, X: zoom in, zoom out, x dimension only
% y, Y: zoom in, zoom