〔@高分悬赏*]怎么样用matlab实现计算机图形放大

作者&投稿:蒋姜 (若有异议请与网页底部的电邮联系)
如何用matlab实现计算机图形放大??~

图形放大及缩小

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

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 out, y dimension only
% arrow keys: pan the data
% a: axis auto
% n: axis normal
% e: axis equal
% g: toggle grid state
% spacebar: toggle axis tick display state
% h: help
%
% Example
% c = pi*(1+sqrt(5))/2;
% x = 0:1000;
% r = 2.72378;
% z = cumsum(exp(i*(c*x.*x + r)));
% plot(real(z),imag(z));
% axdrag
% % Now click, drag, and use special keys ...

% Ned Gulley, March 2003

persistent x0 dx

if nargin < 1,
action = 'initialize';
end

% Use these variables to change the zoom and pan amounts
zoomFactor = 0.9;
panFactor = 0.02;

% Get rid of the help window if it's being displayed
helpTextAxis = findobj(gcbf,'Type','axes','Tag','axdraghelpaxis');
if isempty(helpTextAxis)
helpWasOff = 1;
else
helpWasOff = 0;
delete(helpTextAxis);
end

switch action

case 'initialize'
set(gca,'ButtonDownFcn','axdrag start')
set(gcf,'KeyPressFcn','axdrag keypress')
set(gcf,'DoubleBuffer','on')

case 'start'
set(gcbf,'Units','pixel');
set(gca,'Units','pixel');
set(gcbf,'WindowButtonMotionFcn','axdrag move')
set(gcbf,'WindowButtonUpFcn','axdrag stop')
currentPoint = get(gcbf,'CurrentPoint');
x0 = currentPoint;
axdrag move

case 'move'
currentPoint = get(gcbf,'CurrentPoint');
dx = currentPoint - x0;
x0 = currentPoint;
ap = get(gca,'Position');
xLim = get(gca,'XLim');
yLim = get(gca,'YLim');
set(gca,'XLim',xLim-(diff(xLim)*dx(1)/ap(3)), ...
'YLim',yLim-(diff(yLim)*dx(2)/ap(4)));

case 'stop'
set(gcbf,'WindowButtonMotionFcn','')
set(gcbf,'WindowButtonUpFcn','')
set(gcbf,'Units','normalized');
set(gca,'Units','normalized');

case 'keypress'
currChar = get(gcbf,'CurrentCharacter');
if isempty(currChar)
return
end

if currChar=='a',
axis auto

elseif currChar=='e',
axis equal

elseif currChar=='n',
axis normal

elseif currChar=='g',
grid

elseif currChar==28,
xLim=get(gca,'XLim');
xLimNew = xLim + panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==29,
xLim=get(gca,'XLim');
xLimNew = xLim - panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==30,
yLim=get(gca,'YLim');
yLimNew = yLim - panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif currChar==31,
yLim=get(gca,'YLim');
yLimNew = yLim + panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif abs(currChar)==32,
if isempty(get(gca,'XTick')),
set(gca,'XTickMode','auto','YTickMode','auto')
else
set(gca,'XTick',[],'YTick',[],'Box','on')
end

elseif (currChar=='x') | (currChar=='X'),
if currChar == 'X',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
set(gca,'XLim',xLimNew)

elseif (currChar=='y') | (currChar=='Y'),
if currChar == 'Y',
zoomFactor=1/zoomFactor;
end
yLim=get(gca,'YLim');
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;
set(gca,'YLim',yLimNew)

elseif (currChar=='z') | (currChar=='Z'),
if currChar == 'Z',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
yLim=get(gca,'YLim');

xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;

set(gca,'XLim',xLimNew,'YLim',yLimNew)

elseif currChar=='h',
if helpWasOff
str = { ...
' '
' AXDRAG. Keys you can use are:'
' '
' z, Z: zoom in, zoom out, both dimensions '
' x, X: zoom in, zoom out, x dimension only '
' y, Y: zoom in, zoom out, y dimension only '
' arrow keys: pan the data'
' a: axis auto'
' n: axis normal'
' e: axis equal'
' g: toggle grid state'
' spacebar: toggle axis tick display state'
' h: help'
' '
' Press ''h'' again to dismiss this message'
' ' ...
};
helpTextAxis = axes( ...
'Tag','axdraghelpaxis', ...
'Units','characters', ...
'Position',[2 1 76 16], ...
'Visible','off');
text(0,1,str, ...
'Parent',helpTextAxis, ...
'VerticalAlignment','top', ...
'BackgroundColor',[1 1 0.8], ...
'FontName','courier', ...
'FontSize',6);

end

end

end

你先根据这个微分方程式求出M(t)的表达式:
syms k1 k2;
m=dsolve('DM=k1*exp(-k1*t)-k2*M*exp(-k2*t)')
求出来为:
M=(Int(k1*exp(-k1*t-exp(-k2*t)),t)+C1)*exp(exp(-k2*t))
然后这个就是你要拟合的曲线表达式:现在有三个需要确定的数值,k1,k2和C1
你在用三个实际数据代入这个方程,就能直接求出这三个变量的值

图形放大及缩小

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

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 out, y dimension only
% arrow keys: pan the data
% a: axis auto
% n: axis normal
% e: axis equal
% g: toggle grid state
% spacebar: toggle axis tick display state
% h: help
%
% Example
% c = pi*(1+sqrt(5))/2;
% x = 0:1000;
% r = 2.72378;
% z = cumsum(exp(i*(c*x.*x + r)));
% plot(real(z),imag(z));
% axdrag
% % Now click, drag, and use special keys ...

% Ned Gulley, March 2003

persistent x0 dx

if nargin < 1,
action = 'initialize';
end

% Use these variables to change the zoom and pan amounts
zoomFactor = 0.9;
panFactor = 0.02;

% Get rid of the help window if it's being displayed
helpTextAxis = findobj(gcbf,'Type','axes','Tag','axdraghelpaxis');
if isempty(helpTextAxis)
helpWasOff = 1;
else
helpWasOff = 0;
delete(helpTextAxis);
end

switch action

case 'initialize'
set(gca,'ButtonDownFcn','axdrag start')
set(gcf,'KeyPressFcn','axdrag keypress')
set(gcf,'DoubleBuffer','on')

case 'start'
set(gcbf,'Units','pixel');
set(gca,'Units','pixel');
set(gcbf,'WindowButtonMotionFcn','axdrag move')
set(gcbf,'WindowButtonUpFcn','axdrag stop')
currentPoint = get(gcbf,'CurrentPoint');
x0 = currentPoint;
axdrag move

case 'move'
currentPoint = get(gcbf,'CurrentPoint');
dx = currentPoint - x0;
x0 = currentPoint;
ap = get(gca,'Position');
xLim = get(gca,'XLim');
yLim = get(gca,'YLim');
set(gca,'XLim',xLim-(diff(xLim)*dx(1)/ap(3)), ...
'YLim',yLim-(diff(yLim)*dx(2)/ap(4)));

case 'stop'
set(gcbf,'WindowButtonMotionFcn','')
set(gcbf,'WindowButtonUpFcn','')
set(gcbf,'Units','normalized');
set(gca,'Units','normalized');

case 'keypress'
currChar = get(gcbf,'CurrentCharacter');
if isempty(currChar)
return
end

if currChar=='a',
axis auto

elseif currChar=='e',
axis equal

elseif currChar=='n',
axis normal

elseif currChar=='g',
grid

elseif currChar==28,
xLim=get(gca,'XLim');
xLimNew = xLim + panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==29,
xLim=get(gca,'XLim');
xLimNew = xLim - panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==30,
yLim=get(gca,'YLim');
yLimNew = yLim - panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif currChar==31,
yLim=get(gca,'YLim');
yLimNew = yLim + panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif abs(currChar)==32,
if isempty(get(gca,'XTick')),
set(gca,'XTickMode','auto','YTickMode','auto')
else
set(gca,'XTick',[],'YTick',[],'Box','on')
end

elseif (currChar=='x') | (currChar=='X'),
if currChar == 'X',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
set(gca,'XLim',xLimNew)

elseif (currChar=='y') | (currChar=='Y'),
if currChar == 'Y',
zoomFactor=1/zoomFactor;
end
yLim=get(gca,'YLim');
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;
set(gca,'YLim',yLimNew)

elseif (currChar=='z') | (currChar=='Z'),
if currChar == 'Z',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
yLim=get(gca,'YLim');

xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;

set(gca,'XLim',xLimNew,'YLim',yLimNew)

elseif currChar=='h',
if helpWasOff
str = { ...
' '
' AXDRAG. Keys you can use are:'
' '
' z, Z: zoom in, zoom out, both dimensions '
' x, X: zoom in, zoom out, x dimension only '
' y, Y: zoom in, zoom out, y dimension only '
' arrow keys: pan the data'
' a: axis auto'
' n: axis normal'
' e: axis equal'
' g: toggle grid state'
' spacebar: toggle axis tick display state'
' h: help'
' '
' Press ''h'' again to dismiss this message'
' ' ...
};
helpTextAxis = axes( ...
'Tag','axdraghelpaxis', ...
'Units','characters', ...
'Position',[2 1 76 16], ...
'Visible','off');
text(0,1,str, ...
'Parent',helpTextAxis, ...
'VerticalAlignment','top', ...
'BackgroundColor',[1 1 0.8], ...
'FontName','courier', ...
'FontSize',6);

end

end

end

图形放大及缩小

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

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 out, y dimension only
% arrow keys: pan the data
% a: axis auto
% n: axis normal
% e: axis equal
% g: toggle grid state
% spacebar: toggle axis tick display state
% h: help
%
% Example
% c = pi*(1+sqrt(5))/2;
% x = 0:1000;
% r = 2.72378;
% z = cumsum(exp(i*(c*x.*x + r)));
% plot(real(z),imag(z));
% axdrag
% % Now click, drag, and use special keys ...

% Ned Gulley, March 2003

persistent x0 dx

if nargin < 1,
action = 'initialize';
end

% Use these variables to change the zoom and pan amounts
zoomFactor = 0.9;
panFactor = 0.02;

% Get rid of the help window if it's being displayed
helpTextAxis = findobj(gcbf,'Type','axes','Tag','axdraghelpaxis');
if isempty(helpTextAxis)
helpWasOff = 1;
else
helpWasOff = 0;
delete(helpTextAxis);
end

switch action

case 'initialize'
set(gca,'ButtonDownFcn','axdrag start')
set(gcf,'KeyPressFcn','axdrag keypress')
set(gcf,'DoubleBuffer','on')

case 'start'
set(gcbf,'Units','pixel');
set(gca,'Units','pixel');
set(gcbf,'WindowButtonMotionFcn','axdrag move')
set(gcbf,'WindowButtonUpFcn','axdrag stop')
currentPoint = get(gcbf,'CurrentPoint');
x0 = currentPoint;
axdrag move

case 'move'
currentPoint = get(gcbf,'CurrentPoint');
dx = currentPoint - x0;
x0 = currentPoint;
ap = get(gca,'Position');
xLim = get(gca,'XLim');
yLim = get(gca,'YLim');
set(gca,'XLim',xLim-(diff(xLim)*dx(1)/ap(3)), ...
'YLim',yLim-(diff(yLim)*dx(2)/ap(4)));

case 'stop'
set(gcbf,'WindowButtonMotionFcn','')
set(gcbf,'WindowButtonUpFcn','')
set(gcbf,'Units','normalized');
set(gca,'Units','normalized');

case 'keypress'
currChar = get(gcbf,'CurrentCharacter');
if isempty(currChar)
return
end

if currChar=='a',
axis auto

elseif currChar=='e',
axis equal

elseif currChar=='n',
axis normal

elseif currChar=='g',
grid

elseif currChar==28,
xLim=get(gca,'XLim');
xLimNew = xLim + panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==29,
xLim=get(gca,'XLim');
xLimNew = xLim - panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==30,
yLim=get(gca,'YLim');
yLimNew = yLim - panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif currChar==31,
yLim=get(gca,'YLim');
yLimNew = yLim + panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif abs(currChar)==32,
if isempty(get(gca,'XTick')),
set(gca,'XTickMode','auto','YTickMode','auto')
else
set(gca,'XTick',[],'YTick',[],'Box','on')
end

elseif (currChar=='x') | (currChar=='X'),
if currChar == 'X',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
set(gca,'XLim',xLimNew)

elseif (currChar=='y') | (currChar=='Y'),
if currChar == 'Y',
zoomFactor=1/zoomFactor;
end
yLim=get(gca,'YLim');
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;
set(gca,'YLim',yLimNew)

elseif (currChar=='z') | (currChar=='Z'),
if currChar == 'Z',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
yLim=get(gca,'YLim');

xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;

set(gca,'XLim',xLimNew,'YLim',yLimNew)

elseif currChar=='h',
if helpWasOff
str = { ...
' '
' AXDRAG. Keys you can use are:'
' '
' z, Z: zoom in, zoom out, both dimensions '
' x, X: zoom in, zoom out, x dimension only '
' y, Y: zoom in, zoom out, y dimension only '
' arrow keys: pan the data'
' a: axis auto'
' n: axis normal'
' e: axis equal'
' g: toggle grid state'
' spacebar: toggle axis tick display state'
' h: help'
' '
' Press ''h'' again to dismiss this message'
' ' ...
};
helpTextAxis = axes( ...
'Tag','axdraghelpaxis', ...
'Units','characters', ...
'Position',[2 1 76 16], ...
'Visible','off');
text(0,1,str, ...
'Parent',helpTextAxis, ...
'VerticalAlignment','top', ...
'BackgroundColor',[1 1 0.8], ...
'FontName','courier', ...
'FontSize',6);

图形放大及缩小

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

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 out, y dimension only
% arrow keys: pan the data
% a: axis auto
% n: axis normal
% e: axis equal
% g: toggle grid state
% spacebar: toggle axis tick display state
% h: help
%
% Example
% c = pi*(1+sqrt(5))/2;
% x = 0:1000;
% r = 2.72378;
% z = cumsum(exp(i*(c*x.*x + r)));
% plot(real(z),imag(z));
% axdrag
% % Now click, drag, and use special keys ...

% Ned Gulley, March 2003

persistent x0 dx

if nargin < 1,
action = 'initialize';
end

% Use these variables to change the zoom and pan amounts
zoomFactor = 0.9;
panFactor = 0.02;

% Get rid of the help window if it's being displayed
helpTextAxis = findobj(gcbf,'Type','axes','Tag','axdraghelpaxis');
if isempty(helpTextAxis)
helpWasOff = 1;
else
helpWasOff = 0;
delete(helpTextAxis);
end

switch action

case 'initialize'
set(gca,'ButtonDownFcn','axdrag start')
set(gcf,'KeyPressFcn','axdrag keypress')
set(gcf,'DoubleBuffer','on')

case 'start'
set(gcbf,'Units','pixel');
set(gca,'Units','pixel');
set(gcbf,'WindowButtonMotionFcn','axdrag move')
set(gcbf,'WindowButtonUpFcn','axdrag stop')
currentPoint = get(gcbf,'CurrentPoint');
x0 = currentPoint;
axdrag move

case 'move'
currentPoint = get(gcbf,'CurrentPoint');
dx = currentPoint - x0;
x0 = currentPoint;
ap = get(gca,'Position');
xLim = get(gca,'XLim');
yLim = get(gca,'YLim');
set(gca,'XLim',xLim-(diff(xLim)*dx(1)/ap(3)), ...
'YLim',yLim-(diff(yLim)*dx(2)/ap(4)));

case 'stop'
set(gcbf,'WindowButtonMotionFcn','')
set(gcbf,'WindowButtonUpFcn','')
set(gcbf,'Units','normalized');
set(gca,'Units','normalized');

case 'keypress'
currChar = get(gcbf,'CurrentCharacter');
if isempty(currChar)
return
end

if currChar=='a',
axis auto

elseif currChar=='e',
axis equal

elseif currChar=='n',
axis normal

elseif currChar=='g',
grid

elseif currChar==28,
xLim=get(gca,'XLim');
xLimNew = xLim + panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==29,
xLim=get(gca,'XLim');
xLimNew = xLim - panFactor*diff(xLim);
set(gca,'XLim',xLimNew)

elseif currChar==30,
yLim=get(gca,'YLim');
yLimNew = yLim - panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif currChar==31,
yLim=get(gca,'YLim');
yLimNew = yLim + panFactor*diff(yLim);
set(gca,'YLim',yLimNew)

elseif abs(currChar)==32,
if isempty(get(gca,'XTick')),
set(gca,'XTickMode','auto','YTickMode','auto')
else
set(gca,'XTick',[],'YTick',[],'Box','on')
end

elseif (currChar=='x') | (currChar=='X'),
if currChar == 'X',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
set(gca,'XLim',xLimNew)

elseif (currChar=='y') | (currChar=='Y'),
if currChar == 'Y',
zoomFactor=1/zoomFactor;
end
yLim=get(gca,'YLim');
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;
set(gca,'YLim',yLimNew)

elseif (currChar=='z') | (currChar=='Z'),
if currChar == 'Z',
zoomFactor=1/zoomFactor;
end
xLim=get(gca,'XLim');
yLim=get(gca,'YLim');

xLimNew = [0 zoomFactor*diff(xLim)] + xLim(1) + (1-zoomFactor)*diff(xLim)/2;
yLimNew = [0 zoomFactor*diff(yLim)] + yLim(1) + (1-zoomFactor)*diff(yLim)/2;

set(gca,'XLim',xLimNew,'YLim',yLimNew)

elseif currChar=='h',
if helpWasOff
str = { ...
' '
' AXDRAG. Keys you can use are:'
' '
' z, Z: zoom in, zoom out, both dimensions '
' x, X: zoom in, zoom out, x dimension only '
' y, Y: zoom in, zoom out, y dimension only '
' arrow keys: pan the data'
' a: axis auto'
' n: axis normal'
' e: axis equal'
' g: toggle grid state'
' spacebar: toggle axis tick display state'
' h: help'
' '
' Press ''h'' again to dismiss this message'
' ' ...
};
helpTextAxis = axes( ...
'Tag','axdraghelpaxis', ...
'Units','characters', ...
'Position',[2 1 76 16], ...
'Visible','off');
text(0,1,str, ...
'Parent',helpTextAxis, ...
'VerticalAlignment','top', ...
'BackgroundColor',[1 1 0.8], ...
'FontName','courier', ...
'FontSize',6);

end

end

end

xuyuan008
都是MATLAB内建的函数,进行缩放的时候都会失真的.
要满足它的提问,应该从图形计算方面着手,而不是MATLAB本身.
要无失真的缩放的话,你首先要有自己的算法和要求才行的!

imresize?


〔@高分悬赏*]怎么样用matlab实现计算机图形放大
zoom 指令可以将图形放大或缩小,若要将图形放大时用 zoom on,zoom out,当不再须要放大或缩小图形时用 zoom off。>> M=peaks(25); % peaks 是MATLAB内建的一个像山峰的特别函数,25是这个 >> plot(M) % 函数矩阵的大小,如果数值愈大则画出的山峰图愈平滑 >> zoom on % 开始放大图形,...

高分悬赏!高分悬赏!如何‘死不要脸’!帮帮我吧!
1、准备至少10个笑话,最好经典的,能逗人发笑的。2、先找熟人说一遍,看反应。3、再找其他熟人说一边,稍加点表演。4、找不是很熟的人讲笑话,逗乐他们。5、找女孩子讲笑话,一定要有一些幽默。6、找不太熟的人耍宝,失败了也没人介意。首先,必须先告诉你,你要端正一下自己的态度,不要只...

高分悬赏:“过程已请求一访问对象 但未给访问权限”如何处理?
应该就是个软件引起的.lsass.exe出错,电脑不断重新启动,很是烦人,可试一下以下几种办法看看:先了解一下进程信息lsass.exe:进程文件:lsass或者lsass.exe 进程名称:local安全等级作者ityservice 描述:lsass.exe是一个关于微软安全机制的系统进程,主要处理一些特殊的安全机制和登录策略。出品者:microsoft corp...

[高分悬赏]我喜欢一女孩子 但是貌似他有点讨厌我 我该怎么办
第四,尽量靠近他身边的两位小姐,从他们口中得到一些他的信息。比如他喜欢什么讨厌什么。利用放假回来的机会制造一些惊喜。让他有种有必要正视你的存在的感觉。如果你不能吸引他的注意或令到他对你有一点点感觉,那我劝你还是收拾收拾,早点睡了吧。第五,唉,怎么说呢。这个事情只能尽人事,听天命了。

[高分悬赏]请问手机版恶魔城:苍月的十字架打完第一个boss后怎么走啊?两...
首先请确认是不是玩的苍月,我见过有其他手机版本的也乱改名叫苍月。第一个BOSS应该是飞装甲,打过去之后会得到蓝魂飞装甲,然后再往左边,使用跳+魂,就能够过去。你所说的圣灵没有听说过苍月有,苍月只有个生灵,能够让你快速切换魂的,没有叫圣灵的东西。如果这个地方你实在是跳不过去,可以试试背...

高分悬赏:新手买单反攻略,怎么验机?怎么讲价?
1、新手去大卖场买相机,一般不会遇到翻新机等。2、买机时注意佳能单反都有原厂封贴,一次性的。注意看看封贴有没有二次粘贴的痕迹,看看盒子底部有没有被打开的痕迹。3、打开盒子,保修卡,镜头保修卡,机身,外包装盒三码合一。指机身编码和镜头编码。4、保修卡,说明书等全部都是简体中文,且...

高分悬赏,下级无线路由如何加入上级局域网
把接入线直接接到路由的LAN口,路由LAN口 IP建议可设置与你公司局域网同一段,不冲突即可。关闭无线路由的DHCP功能,开启无线功能。若是你上级的主路由有开启DHCP,则从路由连接的电脑可自动获取IP。若是没有,直接设置与你公司上级局域网一段的固定IP即可。

[高分悬赏]3个多月的泰迪宝宝嘴巴馋,粘人怎么办? - 百度宝宝知道
不要太宠狗狗,小宝贝会被宠成小霸王的,长大了会凶人会咬人的。但是也不要打骂,更不要骗。真诚以待,狗狗会信任你的。小狗做错事的时候,你可以用玩具转移它的注意力。打会影响狗狗跟你的亲密度。不宠的意思是:不是它想怎么样就怎么样,而是你在不伤害它的前提下想怎么样就怎么样。暂时不要摸...

高分悬赏,梦幻西游有两个角色,怎么把一个角色的钱转到另一个_百度知...
首先登陆目前有钱的那个帐号 拉到建业去 注册一个小号 把钱给那个小号 (注意事项: 网络不好的不要使用!!!) 之后换成那个要转账的帐号 然后拿钱~要么先上要拿到钱的号 然后使用离线摆摊(注意事项: 等级>31级才行) 随便弄一个F或7 要多少钱摆多少钱 然后下线换有钱的...

高分悬赏:找个女警当老婆怎么样?有咋利弊?
爱的最高境界是习惯另一个人的习惯,有时候想得太多失去得越多。如果她是个聪明的老婆,用不着你担心她的职业会给你带来强势感,女人终是女人,在外面再强在自己男人面前也只是个普通的妻子。但是如果她的警种很危险的话,你就得想好能否承受那些担心的日子。

栾川县18099974439: 括号 - 搜狗百科
皮泻常衡:[答案] 一个数时:7\r\n两个数时:7*6\/2=21\r\n三个数时:7*6*5\/2\/3=35\r\n四个数时:7*6*5*4\/2\/3\/4=35\r\n五个数时:7*6\/2=21\r\n六个数时:7\r\n七个数时:1\r\n总共:7+21+35+35+21+7+1=127

栾川县18099974439: 关于ln的运算法则 还有log的比如呢个ln(9+6)可以拆开吗真诚求教ln ( 1 + x2 ) = 1 + 2 ln x, -
皮泻常衡:[答案] 不可以.只有乘法和除法才可以的.例如ln(9*6)=ln9+ln6

栾川县18099974439: 求(1+x^2)的负二分之三次方的不定积分~请指教 -
皮泻常衡:[答案] 设x=tant 原式∫1/(1+tan^2 t)^(3/2)dtant =∫sec^2 t/sec^3 t dt =∫costdt =sint tant=x/1 sint=x/√(x^2+1)

栾川县18099974439: 11/23乘以(4/22乘以3/1减去46/77) -
皮泻常衡:[答案] 11/23乘以(4/22乘以3/1减去46/77) =11/23*4/22乘以3/1-11/23*46/77 =6/23-2/7 =3/1

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网